MESI is a cache coherence protocol that keeps multicore caches from returning stale data. Each cached line occupies one of four states: Modified, Exclusive, Shared, or Invalid. section 6.4
The states describe ownership, validity, and agreement with main memory:
- Modified (M): one cache holds a valid copy changed from main memory and may modify it further. section 6.4
- Exclusive (E): one cache holds an unmodified copy matching main memory; a write changes it to Modified. section 6.4
- Shared (S): multiple caches may hold valid, unmodified copies matching main memory. section 6.4
- Invalid (I): the cache line is absent or unusable. section 6.4
A read followed by a write
When a core reads an Invalid line, it obtains the data and receives Exclusive state if no other cache holds it, or Shared state otherwise. Writing a Shared line requires invalidating the other cached copies before the writer can obtain exclusive ownership. section 6.4
