Definition
A History is linearizable if it can be extended to a History
- appending zero or more responses to pending invocations that took effect
- discarding zero or more pending invocations that did not take effect
such that is equivalent to a legal, sequential History
Important
is not required!
It is possible to change inter-thread order, but not intra-thread order
Very similar to Linearizability, but weaker. (Is implied by Linearizability)
General:
- Operations by one thread respect program order
- No need to preserve real-time order
- Cannot reorder operations done by the same thread
- BUT: Can reorder non-overlapping operations done by different threads Is often used to describe multiprocessor memory architectures
Consequence for the Peterson’s algorithm
Warning
Counterexample

Counterexample (even simpler)

Example


The importance of sequential consistency
The pattern “Write mine, read yours” is exactly the flag principle
- Peterson
- Bakery
- It seems non-negotiable!
But
- Too expensive to implement on hardware
- many hardware architects think it is too strong (/ restrictive) Assume: violated by default, honored by explicit request (e.g. volatile)