| Step | P1 cache | P2 cache | Memory |
|---|---|---|---|
| P1 reads A | 5 | – | 5 |
| P2 reads A | 5 | 5 | 5 |
| P1 writes A = 7 | 7 | 5 (stale) | 5 |
| MSI state | Meaning |
|---|---|
| M Modified | Only valid copy; dirty vs. memory |
| S Shared | One or more clean copies |
| I Invalid | Not valid here |
x
| Write-through | Write-back / ownership | |
|---|---|---|
| On write | Update cache + bus write to memory; invalidate/update others | Owner (M or E) writes locally, no bus write |
| Simplicity | ✅ very simple | ❌ more states |
| Bus bandwidth | ❌ ~15% of references are writes: only a few processors | ✅ conserves bandwidth |
Classic ownership protocols: Goodman's write-once, Berkeley ownership, Firefly update.
| Invalidate | Update | |
|---|---|---|
| On a write | Other copies → I | Broadcast new value to other copies |
| Bad case | One producer, many consumers: all N−1 miss after every write | Many writes before anyone reads (x = 1 … x = 100); junk updates to lines no longer used |