Multicore & Synchronization

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.

  • A. Hardware does it automatically.
  • B. Correct. The caches snoop on the traffic.
  • C. The programmer need not be involved.
Practice this topic Back to topic

More Multicore & Synchronization questions

  1. Why do systems with many cores use directory-based coherence instead of snooping?
  2. Coherence protocols can be invalidation-based or update-based. Why do most CPUs use invalidation?
  3. Which describes false sharing in a multithreaded program?
  4. False sharing occurs with an array of per-thread counters such as "long cnt[8];". What is the most suitable fix?
  5. Which describes a data race?