What is Directory-based coherence?

A coherence approach that records in a table which cores hold each line and notifies only those cores. Used in systems with many cores.

Field: Multicore & Synchronization

Japanese name: ディレクトリ方式

What the directory stores

Every memory line has a home node, usually determined by its address, and the home keeps a directory entry for it: a coherence state such as uncached, shared or exclusive, plus a record of which caches hold copies. The simplest record is a full bit vector with one bit per core or cache. Entries live beside the memory controllers or in the shared last-level cache. Since requests go to one home rather than to everyone, the interconnect can be a mesh of point-to-point links rather than a broadcast bus.

A write, step by step

A core that wants to write a line it does not own sends a request to the line's home. The home consults the directory and sends invalidations only to the caches marked as sharers; they drop their copies and acknowledge, either to the home or directly to the requester. Once all acknowledgments arrive, the requester gets exclusive ownership and the directory records it as the owner. If another cache held the line modified, the home forwards the request to that owner, which sends the data to the requester, a so-called three-hop transaction.

Snooping vs. directory

Snooping broadcasts every miss to every cache, giving low latency because there is no extra lookup, but traffic and snoop work grow with the number of cores, which limits it to small systems. A directory adds the latency of a lookup at the home and sometimes an extra hop, but sends messages only where needed, so traffic grows with actual sharing rather than with core count. Large multicore chips and multi-socket systems therefore use directories or hybrids, such as snoop filters that track which caches might hold a line so that most broadcasts can be skipped.

Keeping the directory itself small

A full bit vector for every memory line would cost too much storage as core counts rise, so practical designs economize. Limited-pointer schemes store a few sharer IDs and fall back to broadcast if more caches share the line; coarse vectors use one bit per group of cores. Sparse directories track only lines that are actually cached, organized like a cache themselves. When a sparse directory runs out of entries it must evict one, which forces invalidation of that line in every cache that holds it, so its capacity must be sized generously relative to the caches it tracks.

Try it: questions about Directory-based coherence

Why do systems with many cores use directory-based coherence instead of snooping?

  1. ARecording which cores hold each line lets notices go only to the cores involved, reducing traffic
  2. BDirectory-based coherence makes caches unnecessary
  3. CDirectory-based coherence can notify all cores on every write
Show answer and explanation

Answer: A. Recording which cores hold each line lets notices go only to the cores involved, reducing traffic

Directory-based coherence keeps a table (the directory) recording, for each line, which cores hold copies and in what state. On a write, it consults the directory and sends invalidations only to the cores holding copies. With less traffic than snooping, which notifies all caches at once, it is used in CPUs with dozens of cores or more, such as server processors.

FAQ

Why does directory-based coherence scale better than snooping?

It sends invalidations and requests only to the caches that actually hold a line instead of broadcasting to all of them. Traffic therefore follows real sharing rather than growing with the number of cores.

Is directory-based coherence slower than snooping?

Each miss may take longer because the home's directory must be consulted and requests may be forwarded, but in large systems the reduced traffic and contention usually outweigh that added latency.

What is a snoop filter?

A structure that records which caches might hold each line so that coherence requests are sent only to those caches. It is essentially a directory used to cut broadcast traffic in a snooping-style design.

Questions that mention Directory-based coherence (1)

Directory-based coherence appears in 2 practice questions across 1 topic, including Multicore & Synchronization.

  1. Which describes the snooping approach to cache coherence?

Books on Multicore & Synchronization Ad

As an Amazon Associate I earn from qualifying purchases.

Comparisons that include this term

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary