Sequential consistency
Sequential consistency is a memory model in which participating operations appear in a single total order that preserves each thread’s program order.
C++ Concurrency in Action, Second Edition
Sequentially consistent ordering requires atomic operations using that ordering to fit one total order consistent with each thread's program order.
- How it is used
- Provides the default, easier-to-reason-about ordering for C++ atomic operations.
- How deep it goes
- Works through a four-thread total-order argument and compares guarantees and costs, without detailing CPU instruction sequences.
- Examples
- Uses two atomic flags, two waiting readers, and an assertion that at least one reader sees both flags set.
- What you can do after
- Evaluate/understand whether sequentially consistent atomic operations rule out a proposed four-thread observation.
Read how C++ Concurrency in Action, Second Edition explains sequential consistency →
Modern C
Sequential consistency is a memory-consistency model in which all operations on atomic objects appear in one global order consistent with each thread's program order.
- How it is used
- Uses a strong ordering model to reason about synchronization and the observable order of concurrent atomic operations.
- How deep it goes
- Explains global linearization, acquire-release implications, C interfaces, and performance costs without developing every implementation detail.
- Examples
- Uses a two-thread atomic-synchronization figure and declarations for ordinary and explicit C atomic interfaces.
- What you can do after
- Operate/configure C atomic operations using default sequential consistency or memory_order_seq_cst through _explicit interfaces.
Also covered in
What to know first
- atomicityAtomicity is the property that an operation or group of operations takes effect as an indivisible whole, without observable partial effects.
- atomic typeAn atomic type is a type whose supported accesses and operations are indivisible with respect to concurrent execution and provide defined synchronization semantics.
- happens-before relationA happens-before relation is a partial ordering between events that establishes when one causally precedes another for reasoning about execution and effects.
- acquire-release semanticsAcquire-release semantics are memory-ordering rules under which release operations make preceding effects visible to acquire operations that synchronize with them.
Related concepts
- memory orderingconfigured by · Memory ordering is the set of rules governing the permitted ordering and visibility of memory operations across concurrent execution contexts.
- consistency modelkind of · A consistency model is a formal specification of how operations on state may be ordered and what values those operations can observe.
- acquire-release semanticscontrasts with · Acquire-release semantics are memory-ordering rules under which release operations make preceding effects visible to acquire operations that synchronize with them.
- modification orderproduces · Modification order is the total order of modifications to a particular atomic object, consistent with the sequenced-before order of each participating thread.
- atomicityconfigures · Atomicity is the property that an operation or group of operations takes effect as an indivisible whole, without observable partial effects.
Questions about sequential consistency
What is sequential consistency?
Sequential consistency is a memory model in which participating operations appear in a single total order that preserves each thread’s program order.
Which Manning books explain sequential consistency?
C++ Concurrency in Action, Second Edition and Modern C.
What should I know before learning sequential consistency?
Manning books that teach sequential consistency usually introduce atomicity, atomic type, happens-before relation and acquire-release semantics first.
What is the difference between sequential consistency and acquire-release semantics?
Sequential consistency is a memory model in which participating operations appear in a single total order that preserves each thread’s program order. Acquire-release semantics are memory-ordering rules under which release operations make preceding effects visible to acquire operations that synchronize with them.
What is sequential consistency a kind of?
Sequential consistency is a kind of consistency model. A consistency model is a formal specification of how operations on state may be ordered and what values those operations can observe.
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.

