One way barriers
Full fences are expensive. Acquire and release give cheaper one way ordering that is enough for most synchronization.
- A release write ensures every memory operation before it is visible to a thread that later reads the same location.
- An acquire read ensures operations after it cannot be moved before it.
The pairing
Think of a flag set with release and read with acquire. When the reading thread sees the flag through an acquire load, it is guaranteed to also see everything the writer did before the release store. This is the release before acquire happens before relationship.
Why it is enough
- A release acts as a one way gate that lets earlier work out but not later work back in across the write.
- An acquire is the mirror gate on the read side.
This pairing carries data safely from producer to consumer without forcing the full ordering of a sequentially consistent fence, so it is the common backbone of locks and message passing.
Key idea
A release store paired with an acquire load creates a one way happens before edge so the reader sees all the writer did before the release without a full fence.