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.
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, all-or-nothing unit, without observable partial effects.
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.

