Linearizability makes an operation on shared state appear indivisible and places it in an ordering that threads can observe consistently. For atomic objects, this means one thread can reason about another thread’s completed update instead of treating the access as an interleaved sequence. If a thread observes finished set to true, it can rely on the publishing thread having performed its required preceding actions. section 20.1
Publishing completion with an atomic flag
A shared life simulation declares communication fields with _Atomic, including _Atomic(bool) finished. One thread updates the simulation and sets finished; another observes the flag. Linearizability lets the observer reason about the update as an ordered event rather than an unsynchronized race. section 20.1
// Parameters that will dynamically be changed by // different threads _Atomic(size_t) constellations; //< Constellations visited _Atomic(size_t) x0; //< Cursor position, row _Atomic(size_t) x1; //< Cursor position, column _Atomic(size_t) frames; //< FPS for display _Atomic(bool) finished; //< This game is finished.
These atomic fields show the shared state whose individual accesses receive linearizable treatment. section 20.1
Linearizability also governs mutex-protected critical sections:
- A mutex lock blocks until the calling thread can enter the protected section. section 20.4
- After acquiring a mutex, a thread can rely on operations completed before another thread released that same mutex. section 20.4
- Mutexes protect compound updates such as forcing a 3×3 cell birth, while other accesses use atomic objects. section 20.4



