Multicore & Synchronization

In the MESI protocol, what happens when a core writes to a line it holds in the Exclusive (E) state?

  1. AIt sends invalidation requests to all other cores before writing
  2. BIt cannot write, so it writes to main memory and reads the line back
  3. CNo other core needs to be notified, and the line simply becomes M
Show answer and explanation

Answer: C. No other core needs to be notified, and the line simply becomes M

The E state means only this core holds the line and its contents match main memory. Since there are known to be no other copies, the core can move to M on a write without sending invalidations. The benefit of having E is saving that communication in the common pattern of reading and then writing data used by a single core. Writing from S, by contrast, requires invalidating other copies.

MESI protocol state transitions Local write Remote write Remote write Local read (others have it) Remote write Local read (no others) Local write (invalidate others) Remote read (write back) Local write (no bus msg) Remote read M I S E Local core read/write Snooped read/write by others M: Modified, only here E: Clean, only here S: Clean, shared I: Invalid
MESI protocol state transitions · View in diagrams
  • A. In E there are no other copies, so no notice is needed.
  • B. It can write directly.
  • C. Correct. The core knows it is the only holder.