Acquire semantics prevent reads from moving earlier than a synchronization operation. Lock acquisition provides this guarantee, helping a thread observe shared data after another thread releases its lock. section 7.2
Use acquire semantics together with the complementary ordering rules:
- Treat lock acquisition as an acquire operation and lock release as a release operation. section 7.2
- Prefer locks for shared data; relying on volatile does not guarantee the latest value and can introduce further problems. section 7.2
- Distinguish acquire and release semantics from memory barriers, which constrain reads and writes in both directions. section 7.2
Figure 7.1 Acquire and release semantics
Use the acquire-and-release diagram to visualize how synchronization limits compiler and CPU memory reordering. section 7.2




