This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Memory model release/acquire mode interactions of relaxed atomic operations


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]