Multicore, Coherence & Thread-Level Parallelism

write-invalidate

When one editor changes the shared page, there are two ways to keep everyone honest. You could phone every other editor and dictate the new sentence so their copies stay current — or you could simply tell them 'your copy is now void; throw it away,' and let them fetch a fresh copy only if and when they actually need it. The second way is write-invalidate: on a write, the writer destroys all other cached copies rather than updating them.

Here is the mechanism. Before a core writes a shared line, it sends an invalidate for that line; every other cache holding it marks its copy Invalid and discards it. The writer is now the sole holder and can write freely. If another core later needs that data, its read misses, and it fetches the new value — so the data only moves when someone genuinely wants it. The alternative, write-update (or write-broadcast), instead pushes the new value to every sharer on each write. Write-invalidate sends one invalidation regardless of how big the data is and however many times the writer keeps writing; write-update sends the full new value every single time.

Write-invalidate wins in almost all real systems, and the reason is the common access pattern: a core often writes the same line many times in a row (a loop updating a variable) before another core reads it. Invalidate pays once — a single invalidation — and then the writer hammers the line privately for free; write-update would broadcast every one of those writes, flooding the bus. The trade flips only for data that is written once and immediately read by many waiting cores, which is rare. The honest cost of invalidate is that the next reader takes a miss to refetch, but that is usually cheaper than constant broadcasts.

A core runs a loop writing a counter 1000 times while three other cores hold the line. Write-invalidate: one invalidate clears the three copies, then 1000 private writes cost nothing on the bus. Write-update: each of the 1000 writes broadcasts the new value to the three sharers — 3000 update messages versus one invalidate.

Invalidate pays once and then lets repeated writes run free; update re-broadcasts every write — which is why invalidate dominates real hardware.

Write-invalidate is the default in modern coherence (it is what MESI uses) because real workloads write a line many times before sharing it. Write-update only pays off in the rare write-once-read-by-many pattern.

Also called
invalidation protocolwrite-update (the alternative)失效協定