The intuitive model
Sequential consistency is the memory model most programmers imagine by default. It says that the result of any execution is as if all operations of all threads ran in some single total order, and each thread keeps its own program order within that sequence.
What it forbids
Under sequential consistency:
- No thread sees its own operations out of program order.
- There is one consistent interleaving that explains every observed value.
- The store load reordering caused by store buffers is not allowed.
The cost
This clarity is expensive. To provide it the hardware would have to drain store buffers and forbid many reorderings, inserting fences around nearly every shared access. Real processors therefore offer weaker models by default and let software request sequential consistency only where needed, often through specially ordered atomic operations.
It remains the gold standard for reasoning. Many algorithms are first proved correct assuming it, then carefully relaxed.
Key idea
Sequential consistency makes all operations appear in one global order that respects each thread program order, which is easy to reason about but costly to provide.