What is Bus snooping?

A coherence approach in which each cache watches other cores' reads and writes on a shared bus or similar and updates its own line states. It suits small core counts.

Field: Multicore & Synchronization

Japanese name: スヌーピング

How it works

When a core wants to write to a cache line, it sends a request to all caches saying that copies of this line must be invalidated. Each of the other caches sees the request and invalidates the line if it holds it. When the data a core wants to read is not in its own cache, it likewise sends a request to all. A cache that holds the line responds and hands over the data. State transitions such as those of MESI are driven by these exchanges.

Comparison with the directory scheme

Snooping asks everyone, so the mechanism is simple and responses are fast. In exchange, the amount of traffic grows as cores are added. A directory scheme records in a table which cores hold which lines and sends requests only to the cores concerned. It suits large numbers of cores, but needs the extra delay of consulting the table and memory for the table. Many current processors keep ownership information in the cache shared by all cores and use it to narrow down whom to ask, which lies between the two schemes.

Effect on programs

When several cores write to the same line repeatedly, an invalidation request is sent each time and the line bounces back and forth between the cores. This happens even when the cores are not contending for the same variable, merely because different variables happen to sit on the same line. This is also one of the reasons heavy contention for a lock is slow. If the cores only read, all of them can keep their copies and no exchange occurs.

Try it: questions about Bus snooping

Which describes the snooping approach to cache coherence?

  1. AThe OS periodically inspects every cache and fixes discrepancies
  2. BEach core's cache watches other cores' reads and writes on a shared bus or similar and updates its own line states
  3. CThe programmer manually sends values to other cores on each write
Show answer and explanation

Answer: B. Each core's cache watches other cores' reads and writes on a shared bus or similar and updates its own line states

In snooping, every core's read and write requests reach all caches, and each cache checks whether it holds the same line and invalidates it or supplies data. It is simple and suits a small number of cores. As cores increase, broadcasting every request to every cache generates too much traffic, so large systems use 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 it suit a small number of cores?

Requests go to everyone, so as cores are added, the traffic and the burden on the wiring that carries it increase. With few cores the burden is small and the advantages of simplicity and speed prevail.

Is it the same as the snooping used in networking?

It is a different technology. The meaning of the word, watching passing traffic from the side, is shared, but here it refers to the mechanism that keeps cache contents consistent.

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