Diagnosing a Weak Memory Ordering Bug
robert.ocallahan.org
robert.ocallahan.org
My understanding is that acq_rel is sufficient for many use-cases, as opposed to seq_cst.
Release write/relaxed read is more useful, typically for work/cancel/finish flags that are spun on similarly to condition variables.
The actual bug in question used relaxed memory ordering, and the fix was to use acquire/release. Relaxed memory ordering really should be reserved for scenarios where you need atomicity but absolutely no synchronization (statistics counters are the only case that readily comes to mind).
POSIX requires memory barrier in addition to that on the pthread pair, making it get more different, and both major C++ library implementations defer to pthreads.