2 ms·
Back when this post was written, I would have agreed with you. But Mara's book makes a good case for this: https://marabos.nl/atomics/memory-ordering.html#comm
by jamesmunns 3y ago
Back when this post was written, I would have agreed with you. But Mara's book makes a good case for this:
https://marabos.nl/atomics/memory-ordering.html#common-misconceptions https://marabos.nl/atomics/memory-ordering.html#common-misco...
More importantly, when reading code, SeqCst basically tells the reader:
"this operation depends on the total order of every single SeqCst operation
in the program," which is an incredibly far-reaching claim. The same code
would likely be easier to review and verify if it used weaker memory ordering
instead, if possible...
It is advisable to see SeqCst as a warning sign.