Multicore & Synchronization

Two cores each hold a copy of variable x in their own caches. After core 0 writes x, what problem could occur when core 1 reads x if there were no cache coherence mechanism?

  1. ACore 1 reads the stale value left in its own cache
  2. BCore 1's read is always faster than core 0's write
  3. Cx is read as double its value
Show answer and explanation

Answer: A. Core 1 reads the stale value left in its own cache

In a multicore CPU, each core's cache can hold a copy of the same address. If core 0 updates x only in its own cache, core 1's cache keeps the old value and core 1 reads it. A cache coherence mechanism, for example by invalidating other cores' copies on a write, ensures that every core sees the latest value.

  • A. Correct. The copies fall out of sync.
  • B. It is a question of correctness, not speed.
  • C. Values do not change by themselves.
Practice this topic Back to topic

More Multicore & Synchronization questions

  1. Which correctly lists the four states of the MESI cache coherence protocol?
  2. In the MESI protocol, what does it mean when a cache line is in the Modified (M) state?
  3. In the MESI protocol, what happens when a core writes to a line it holds in the Exclusive (E) state?
  4. In an invalidation-based coherence protocol, what happens when a core writes to a line in the Shared (S) state?
  5. In MESI, when core 1 tries to read a line that core 0 holds in the Modified (M) state, what generally happens?