Multicore & Synchronization

Coherence protocols can be invalidation-based or update-based. Why do most CPUs use invalidation?

  1. AWhen the same core writes a line repeatedly, only the first write needs an invalidation, so traffic is lower
  2. BWith update-based protocols other cores read stale values
  3. CInvalidation doubles cache capacity
Show answer and explanation

Answer: A. When the same core writes a line repeatedly, only the first write needs an invalidation, so traffic is lower

An update-based protocol sends the new value to other copies on every write, which helps if other cores read it soon, but generates traffic on each of a core's repeated writes. With invalidation, after the first write invalidates other copies, further writes to the M line need no communication. Real programs often write repeatedly, so invalidation is the norm.

  • A. Correct. Update-based protocols send the value on every write.
  • B. Update-based protocols also stay correct; the issue is traffic.
  • C. Capacity does not change.
Practice this topic Back to topic

More Multicore & Synchronization questions

  1. Which describes false sharing in a multithreaded program?
  2. False sharing occurs with an array of per-thread counters such as "long cnt[8];". What is the most suitable fix?
  3. Which describes a data race?
  4. When two threads run the code above simultaneously, the final counter can be less than 200000. Why?
  5. Which describes an atomic instruction?