liveBook · Manning

Cache-coherent system

As explained in Latency

Cache coherence is the property that multiple caches maintain mutually consistent views of shared data.

A cache-coherent system keeps multiple caches consistent when they hold data from the same memory region. In a multicore CPU, each core may cache the same data; when one core writes, other caches must update or invalidate their copies so programs do not read stale values. section 6.4

Two cores sharing a value

Suppose two cores cache the same memory value. Both can initially read their local copies, but a write by one core makes the other copy stale unless the caches coordinate. A coherence protocol such as MESI manages this coordination for cache lines, such as a 64-byte block. The consistency guarantee simplifies programming, but coordination adds latency to updates. section 6.4

Cache coherence is distinct from general distributed-cache freshness. Distributed caches may intentionally remain incoherent when applications can tolerate stale reads, avoiding the coordination cost of keeping every copy current. section 6.4 section 6.11

How Latency covers it

How deep it goes
Defines stale-data failure, explains write coordination, names MESI, and stops short of fully detailing all protocol states.
Examples
Uses per-core caches holding the same value and a 64-byte cache line to illustrate stale reads after a write.
What it assumes
Explains per-core caching and stale data directly, without requiring prior knowledge of coherence protocols.
What you can do after
Evaluate/understand why multicore programs avoid stale reads and why coherence introduces update latency.
How it connects
Links cache coherence to multicore systems, shared memory, cache lines, MESI, distributed caching, and stale reads.

Also explained in

Compare how 2 books explain cache-coherent system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.