Skip to content

nagarajan sorin hill wood 2020

Record metadata
cite: Vijay Nagarajan, Daniel J. Sorin, Mark D. Hill and David A. Wood, A Primer on Memory Consistency and Cache Coherence, second edition, Synthesis Lectures on Computer Architecture, Morgan & Claypool / Springer, 2020 (first edition by Sorin, Hill and Wood, 2011).
url: https://pages.cs.wisc.edu/~markhill/papers/primer2020_2nd_edition.pdf
status: read
anchors: setup#1, setup#34

The standard short account of cache coherence, open access. Read on 28 November 2026 by a claude-code session for lines/contention-and-the-shared-file.md, from the copy on the Wisconsin page above (printed page numbers below).

  • §2.4, pp. 12–13: coherence is defined "through the single-writer–multiple-reader (SWMR) invariant. For any given memory location, at any given moment in time, there is either a single core that may write it (and that may also read it) or some number of cores that may read it." A location's lifetime "is divided up into epochs. In each epoch, either a single core has read-write access or some number of cores (possibly zero) have read-only access."
  • p. 13, boxed: "Data-Value Invariant. The value of the memory location at the start of an epoch is the same as the value of the memory location at the end of the its last read-write epoch." (So printed, "the its".) The SWMR invariant alone is not coherence: values must also be carried from one epoch to the next.
  • p. 13: an equivalent formulation by tokens: a fixed number of tokens per location, at least the number of cores; all tokens to write, one or more to read.
  • §2.4.1, p. 14: in "invalidate protocols", a core that wants to write sends messages "to ensure that no other cores have cached copies of the memory location in either read-only or read-write states".
  • §2.4.2, p. 14: "in practice, coherence is usually maintained at the granularity of cache blocks … it is not possible for one core to be writing to the first byte of a block while another core is writing to another byte within that block."
  • §9.2.2, p. 199: "False sharing occurs when two cores are reading and writing different data that happen to reside on the same cache block. Even though the cores are not actually sharing the data on the block (i.e., the sharing is false), there can be a significant amount of coherence traffic between the cores for the block." Its likelihood "is a function of the block size … and the workload". Two remedies are named: sub-block coherence and speculation.

  • §7, pp. 107–108: traditional snooping protocols broadcast requests on "an ordered broadcast network, such as a bus", giving "a total order of coherence requests" (p. 107); they "create a total order of coherence requests across all blocks, even though coherence requires only a per-block order of requests" (p. 108).

Not read: the chapters on consistency models (3–5) and on protocols in detail (6, the rest of 7, and 8 on directories).