Acquire-release semantics
Acquire-release semantics are memory-ordering rules under which release operations make preceding effects visible to acquire operations that synchronize with them.
C++ Concurrency in Action, Second Edition
Acquire-release ordering provides synchronization when an acquire operation reads a value written by a release operation, without imposing a single global order.
- How it is used
- Coordinates visibility of writes between threads without requiring sequential consistency.
- How deep it goes
- Works through matching release and acquire operations, their ordering of relaxed writes, transitive synchronization, and the absence of total order.
- Examples
- Uses two atomic flags, a release-published relaxed write, and a three-thread synchronization chain.
- What you can do after
- Apply it via std::atomic release stores and acquire loads to publish earlier writes between threads.
Read how C++ Concurrency in Action, Second Edition explains acquire-release semantics →
Modern C
A release operation is a concurrency operation that publishes preceding effects so that a corresponding acquire can observe them.
- How it is used
- Uses acquire-release semantics to reason about visibility and ordering of effects across threads.
- How deep it goes
- Defines synchronization and visibility rules, then relates explicit memory orders to operation restrictions and consistency trade-offs.
- Examples
- Uses an atomic decrement observing a write, an explicit atomic increment, and shared error-log initialization.
- What you can do after
- Apply it via C’s explicit atomic interfaces and library synchronization pairs, with careful memory-order selection.
Modern C, Third Edition
Release semantics are memory-ordering properties that make preceding effects available to a thread that synchronizes with the release operation.
- How it is used
- Uses synchronization to reason about cross-thread timing and visibility of effects.
- How deep it goes
- Explains synchronization and visibility rules for atomics and library calls, while setting aside memory_order_consume and dependency-ordered before.
- Examples
- Uses two threads modifying an atomic x and critical sections protected by a mutex.
- What you can do after
- Evaluate and understand when effects become visible across synchronized threads and why condition-variable signaling needs care.
Read how Modern C, Third Edition explains acquire-release semantics →
C# Concurrency: Asynchronous and multithreaded programming
Release semantics are memory-ordering guarantees that prevent writes from being moved later than a synchronization operation.
- How it is used
- Protects visibility of shared-data updates when a thread releases a lock.
- How deep it goes
- Defines write-ordering guarantees and relates them to locks, acquire operations, memory barriers, and the memory model.
- Examples
- Uses lock release and Figure 7.1 to illustrate writes becoming available to the next thread.
- What you can do after
- Apply it by locking shared-data access so released changes become visible to the next thread.
What to know first
- lockingLocking is a synchronization technique that controls concurrent access to a shared resource or protected operation.
Related concepts
- memory_order_relaxedcontrasts with · memory_order_relaxed is an atomic memory-ordering mode that preserves atomicity and each atomic object's modification order without imposing additional synchronization or ordering on other memory operations.
- acquire semanticsconfigured by · Acquire semantics prevent subsequent memory operations from being reordered before an acquire operation and make visible effects that happen-before it, including those published by a synchronizing release operation.
- std::memory_order_releaseconfigured by · A C++ memory-order value that gives an atomic store release semantics, making preceding operations visible to a thread that performs a matching acquire operation.
- sequential consistencycontrasts with · Sequential consistency is a memory model in which participating operations appear in a single total order that preserves each thread’s program order.
- read-modify-write operationused by · A read-modify-write operation reads a value from a location, modifies or selects a new value, and writes the result back to that location.
Questions about acquire-release semantics
What is acquire-release semantics?
Acquire-release semantics are memory-ordering rules under which release operations make preceding effects visible to acquire operations that synchronize with them.
Which Manning books explain acquire-release semantics?
C++ Concurrency in Action, Second Edition, Modern C, Modern C, Third Edition and C# Concurrency: Asynchronous and multithreaded programming.
What should I know before learning acquire-release semantics?
Manning books that teach acquire-release semantics usually introduce locking first.
What is the difference between acquire-release semantics and memory_order_relaxed?
Acquire-release semantics are memory-ordering rules under which release operations make preceding effects visible to acquire operations that synchronize with them. memory_order_relaxed is an atomic memory-ordering mode that preserves atomicity and each atomic object's modification order without imposing additional synchronization or ordering on other memory operations.
What is acquire-release semantics a kind of?
Acquire-release semantics is a kind of memory_order. memory_order is the C atomic-memory-order enumeration type whose values specify the synchronization semantics of atomic operations.
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.



