Sequential consistency¶
Category: Safety in languages · Status: stub
One line: Operations appear to happen in some single order that respects each task's own order, though not necessarily real time — weaker than linearizability.
Also called: SeqCst.
How it connects¶
flowchart LR
n_linearizability["Linearizability"]
n_sequential_consistency["Sequential consistency"]
n_linearizability ---|vs| n_sequential_consistency
classDef center stroke-width:3px
class n_sequential_consistency center
classDef outside stroke-dasharray: 4 3
class n_linearizability outside
- Often confused with: Linearizability
- See also: Consistency models
In each language¶
| Rust | Ordering::SeqCst ↗ additionally preserves a total order of such operations across all threads |
| C | The generic atomic_compare_exchange ↗ functions use memory_order_seq_cst by default |
| C++ | std::memory_order_seq_cst ↗: the default for all atomic operations, sequentially consistent ordering |
Where to read more¶
- In the books: Rust Atomics and Locks, Mara Bos — ch. 3, 'Memory Ordering' → 'Sequentially Consistent Ordering'
- In the books: The Art of Multiprocessor Programming, Maurice Herlihy, Nir Shavit — ch. 3, 'Concurrent Objects' → 'Sequential Consistency'
- Notes: sequential consistency ↗
- Reference: Wikipedia: Sequential consistency ↗