GCC Wiki AtomySync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To whom it may concern,

In the example below the title  "Overall Summary" the Wiki reads
"*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.

(  *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!



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux