As far as I know, acquire/release semantics act as a middle ground between sequential consistency and the unconditional memory reordering freedom allowed by a weaker memory model (or "relaxed", as C++ calls it). In a nutshell:
- Acquire semantics prevent memory reordering of a
read
with anyread
orwrite
operation that follows it in program order; - Release semantics prevent memory reordering of a
write
with anyread
orwrite
operation that precedes it in program order.
Cool. But those guarantees, combined together, look like sequential consistency to me. What does sequential consistency provide that acquire/release semantics together don't? Could you give an example?