Memory model release/acquire mode interactions of relaxed atomic operations

Jonathan Wakely jwakely.gcc@gmail.com
Thu May 4 11:20:00 GMT 2017


On 4 May 2017 at 10:24, Toebs Douglass wrote:
> Atomic in this context, I believe, actually only really means the
> absence of word-tearing; you won't write half your int and then get
> swapped out and then write the other half later.

No, "atomic" in the C++ memory model has a specific meaning, more than
just guaranteeing no word-tearing. Even on a CPU architecture where
word-tearing is impossible, the use of atomic operations rather than
non-atomic ones gives information to the compiler that affects the
semantics.



More information about the Gcc-help mailing list