Assuming that you don't care about anything other than correctness then Acquire
and Release
are all you need. There are certain very weird algorithms where the extra guarantee from SeqCst
enables you to put bounds on memory consumption, CPU time, and similar non-correctness things.
The reason I say that Acquire
and Release
are OK if you can justify them is that they're sufficiently scary to put off people who don't know what they're doing, while still good enough to write lock-free algorithms if you know what you're doing. Because the names are a bit strange, and the description is technical and complex, people tend to shy away from them.
The trouble with SeqCst
is that it's an attractive nuisance; it "looks" to the naïve eye like a magic "do what I want" ordering, but most of the time (all but one time I've seen it during code review - the other time had a reference to a peer-reviewed paper showing why SeqCst
was worthwhile here) you either needed Relaxed
(on the systems we were going to run that code on, cost around 10x a non-atomic access) and are paying the price of SeqCst
or you're not actually getting the guarantees you expected (notably around the behaviour of non-atomic reads and writes between SeqCst
reads and writes).