|
Ordering Memory op
- A memory operation is said to complete when it has performed with respect to all processors in the system
- Assume that there is a single shared memory and no caches
- Memory operations complete in shared memory when they access the corresponding memory locations
- Operations from the same processor complete in program order: this imposes a partial order among the memory operations
- Operations from different processors are interleaved in such a way that the program order is maintained for each processor: memory imposes some total order (many are possible)
Example
P0: x=8; u=y; v=9;
P1: r=5; y=4; t=v;
Legal total order:
x=8; u=y; r=5; y=4; t=v; v=9;
Another legal total order:
x=8; r=5; y=4; u=y; v=9; t=v;
- “Last” means the most recent in some legal total order
- A system is coherent if
- Reads get the last written value in the total order
- All processors see writes to a location in the same order
|