|
|
|
|
|
by MaxGanzII
1554 days ago
|
|
A barrier, of any kind, makes no difference here. Barriers only influence the order in which events become visible if and when they DO become visible. Barriers say nothing about whether or not events actually do become visible; and it may be that they never do (if the necessary magic is not performed, etc). You mention an atomic increment. I don't see atomic increments this in the C11 code, but I'm not up to speed with that version of the specification. (Note that an atomic increment will solve the write-side problem, but not the read-side problem. The reader must still use a read barrier; but if there's an implicit full barrier, then that's being done.) |
|
A fence or atomic operation guarantee that a store will be visible globally in a finite amount of time
Edit: that's true for C11 _Atomic as well (I had to double check), I.e. x++ if x is an _Atomic int is both atomic and seqcst