On Thu, 20 Jul 2023 at 08:12, m g via Gcc-help <gcc-help@xxxxxxxxxxx> wrote: > > To whom it may concern, > > In the example below the title "Overall Summary" the Wiki reads Where "the Wiki" means https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync > "*Release/acquire > ... thread 3's assert can fail.There has been no synchronization between > threads 1 and 3, so no value can be assumed for 'x' there.*" > > Are you sure about this sentence "thread 3's assert *can* fail"? > Although the synchronization happens between threads 2 and 3; x.store (10) > in thread 1 still inter-thread happens before y.store (10) in thread 2 > therefore if (y.load() == 10) is true in thread 3 thread 3's assert > *cannot* fail. The statement would be true if the loads in thread 3 were relaxed. I think you're right that for MO acquire in thread 3 there's a happens-before relation. That wiki page is over a decade old and not maintained or really of interest to anybody now. > > ( *5) A inter-thread happens-before some evaluation X, and X inter-thread > happens-before B* from https://en.cppreference.com/w/cpp/atomic/memory_order > ) > > *Obviously* I can be wrong, let me know!