Release operation
An atomic operation with release ordering that synchronizes with a corresponding acquire operation, making preceding effects visible.
C++ Concurrency in Action, Second Edition
A release operation is an atomic operation whose ordering can synchronize with an acquire operation on the same memory location.
- How it is used
- Publishes earlier writes through an atomic location so an acquiring thread can access protected or newly constructed data.
- How deep it goes
- Traces sequenced-before, synchronizes-with, and happens-before through a spinlock and successful or failed stack compare/exchange operations.
- Examples
- Uses an atomic_flag spinlock and a reference-counted lock-free stack whose compare/exchange operations distinguish success from failure ordering.
- What you can do after
- Apply it via C++ atomic memory orders to publish data with release and require acquire before reading dependent non-atomic fields.
Read how C++ Concurrency in Action, Second Edition explains release operation →
Modern C, Third Edition
A release operation is a synchronization operation that makes preceding effects available to a corresponding acquire operation.
- How it is used
- Coordinates visibility of effects between threads through paired C library synchronization actions.
- How deep it goes
- Defines publication through synchronization and works through call_once, while deferring detailed mutex behavior.
- Examples
- Uses call_once initialization, thread creation and joining, thread termination, and mutex release–acquisition pairs.
- What you can do after
- Evaluate which preceding effects become visible after a corresponding C synchronization operation.
Read how Modern C, Third Edition explains release operation →
Related concepts
- synchronizes-with relationproduces · A synchronizes-with relation is an inter-thread ordering relationship in which a synchronization operation establishes visibility of effects from one thread to another.
- call_onceimplemented by · call_once is a threading operation that coordinates callers so a specified callback is successfully executed at most once for a given once-control object.
- release barrierequivalent to · A release barrier is a memory-ordering constraint that prevents preceding memory operations from being moved after the barrier.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

