encyclopegia.org

Cache coherence

In computer architecture, cache coherence is the uniformity of shared resource data that is stored in multiple local caches. In a cache coherent system, if multiple clients have a cached copy of the same region of a shared memory resource, all copies are the same. Without cache coherence, a change made to the region by one client may not be seen by others, and errors can result when the data used by different clients is mismatched. A cache coherence protocol is used to maintain cache coherency. The two main types are snooping and directory-based protocols. Cache coherence is of particular relevance in multiprocessing systems, where each CPU may have its own local cache of a shared memory resource.

In computer architecture, cache coherence is the uniformity of shared resource data that is stored in multiple local caches. In a cache coherent system, if multiple clients have a cached copy of the same region of a shared memory resource, all copies are the same. Without cache coherence, a change made to the region by one client may not be seen by others, and errors can result when the data used by different clients is mismatched. A cache coherence protocol is used to maintain cache coherency. The two main types are snooping and directory-based protocols. Cache coherence is of particular relevance in multiprocessing systems, where each CPU may have its own local cache of a shared memory resource. ==Overview== In a shared memory multiprocessor system with a separate cache memory for each processor, it is possible to have many copies of shared data: one copy in the main memory and one in the local cache of each processor that requested it. When one of the copies of data is changed, the other copies must reflect that change. Cache coherence is the discipline which ensures that the changes in the values of shared operands (data) are propagated throughout the system in a timely fashion. The following are the requirements for cache coherence: Write Propagation: Changes to the data in any cache must be propagated to other copies (of that cache line) in the peer caches. Transaction Serialization: Reads/Writes to a single memory location must be seen by all processors in the same order. Theoretically, coherence can be performed at the load/store granularity. However, in practice it is generally performed at the granularity of cache blocks. ==Definition== Coherence defines the behavior of reads and writes to a single address location. In a multiprocessor system, consider that more than one processor has cached a copy of the memory location X. The following conditions are necessary to achieve cache coherence: In a read made by a processor P to a location X that follows a write by the same processor P to X, with no writes to X by another processor occurring between the write and the read instructions made by P, X must always return the value written by P. In a read made by a processor P1 to location X that follows a write by another processor P2 to X, with no other writes to X made by any processor occurring between the two accesses and with the read and write being sufficiently separated, X must always return the value written by P2. This condition defines the concept of coherent view of memory. Propagating the writes to the shared memory location ensures that all the caches have a coherent view of the memory. If processor P1 reads the old value of X, even after the write by P2, we say that the memory is incoherent. The above conditions satisfy the Write Propagation criteria required for cache coherence. However, they are not sufficient as they do not satisfy the Transaction Serialization condition. To illustrate this better, consider the following example: A multi-processor system consists of four processors - P1, P2, P3 and P4, all containing cached copies of a shared variable S whose initial value is 0. Processor P1 changes the value of S (in its cached copy) to 10 following which processor P2 changes the value of S in its own cached copy to 20. If we ensure only write propagation, then P3 and P4 will certainly see the changes made to S by P1 and P2. However, P3 may see the change made by P1 after seeing the change made by P2 and hence return 10 on a read to S. P4 on the other hand may see changes made by P1 and P2 in the order in which they are made and hence return 20 on a read to S. The processors P3 and P4 now have an incoherent view of the memory. Therefore, in order to satisfy Transaction Serialization, and hence achieve Cache Coherence, the following condition along with the previous two mentioned in this section must be met: Writes to the same location must be sequenced. In other words, if location X received two different values A and B, in this order, from any two processors, the processors can never read location X as B and then read it as A. The location X must be seen with values A and B in that order. The alternative definition of a coherent system is via the definition of sequential consistency memory model: "the cache coherent system must appear to execute all threads’ loads and stores to a single memory location in a total order that respects the program order of each thread". Thus, the only difference between the cache coherent system and sequentially consistent system is in the number of address locations the definition talks about (single memory location for a cache coherent system, and all memory locations for a sequentially consistent system). Another definition is: "a multiprocessor is cache consistent if all writes to the same memory location are performed in some sequential order". Rarely, but especially in algorithms, coherence can instead refer to the locality of reference. Multiple copies of the same data can exist in different cache simultaneously and if processors are allowed to update their own copies freely, an inconsistent view of memory can result. ==Coherence protocols== Coherence protocols apply cache coherence in multiprocessor systems. The intention is that two clients must never see different values for the same shared data. The protocol must implement the basic requirements for coherence. It can be tailor-made for the target system or application. Protocols can also be classified as snoopy or directory-based. Typically, early systems used directory-based protocols where a directory would keep a track of the data being shared and the sharers. In snoopy protocols, the transaction requests (to read, write, or upgrade) are sent out to all processors. All processors snoop the request and respond appropriately. Write propagation in snoopy protocols can be implemented by either of the following methods: Write-invalidate: When a write operation is observed to a location that a cache has a copy of, the cache controller invalidates its own copy of the snooped memory location, which forces a read from main memory of the new value on its next access. Write-update: When a write operation is observed to a location that a cache has a copy of, the cache controller updates its own copy of the snooped memory location with the new data. If the protocol design states that whenever any copy of the shared data is changed, all the other copies must be "updated" to reflect the change, then it is a write-update protocol. If the design states that a write to a cached copy by any processor requires other processors to discard or invalidate their cached copies, then it is a write-invalidate protocol. However, scalability is one shortcoming of broadcast protocols. Various models and protocols have been devised for maintaining coherence, such as MSI, MESI (aka Illinois), MOSI, MOESI, MERSI, MESIF, write-once, Synapse, Berkeley, Firefly and Dragon protocol. In 2011, ARM Ltd proposed the AMBA 4 ACE for handling coherency in SoCs. The AMBA CHI (Coherent Hub Interface) specification from ARM Ltd, which belongs to AMBA5 group of specifications defines the interfaces for the connection of fully coherent processors. ==See also== Consistency model Directory-based coherence Memory barrier Non-uniform memory access (NUMA) False sharing ==References== ==Further reading==

References

  1. Design of a Snoop Filter for Snoop-Based Cache Coherency Protocols · retrieved 2014-01-19 · rev 1353471089
    Cite this reference

    MLA "Design of a Snoop Filter for Snoop-Based Cache Coherency Protocols." Rasmus Ulfsnes (June 2013). 2014-01-19. http://www.diva-portal.org/smash/get/diva2:649627/FULLTEXT01.pdf. Accessed 24 November 2026.

    Chicago "Design of a Snoop Filter for Snoop-Based Cache Coherency Protocols." Rasmus Ulfsnes (June 2013). 2014-01-19. http://www.diva-portal.org/smash/get/diva2:649627/FULLTEXT01.pdf.

    APA Rasmus Ulfsnes (June 2013). (2014). Design of a Snoop Filter for Snoop-Based Cache Coherency Protocols. Retrieved November 24, 2026, from http://www.diva-portal.org/smash/get/diva2:649627/FULLTEXT01.pdf

  2. Lecture 18: Snooping vs. Directory Based Coherency · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "Lecture 18: Snooping vs. Directory Based Coherency." "Lecture 18: Snooping vs. 2026-11-17. https://people.eecs.berkeley.edu/~pattrsn/252F96/Lecture18.pdf. Accessed 24 November 2026.

    Chicago "Lecture 18: Snooping vs. Directory Based Coherency." "Lecture 18: Snooping vs. 2026-11-17. https://people.eecs.berkeley.edu/~pattrsn/252F96/Lecture18.pdf.

    APA "Lecture 18: Snooping vs. (2026). Lecture 18: Snooping vs. Directory Based Coherency. Retrieved November 24, 2026, from https://people.eecs.berkeley.edu/~pattrsn/252F96/Lecture18.pdf

  3. Kriouile (16 September 2013). Formal Analysis of the ACE Specification for Cache Coherent Systems-on-Chip. In Formal Methods for Industrial Critical Systems . Springer Berlin Heidelberg. ISBN 978-3-642-41010-9 . Wikipedia revision 1353471089, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "Kriouile (16 September 2013). Formal Analysis of the ACE Specification for Cache Coherent Systems-on-Chip. In Formal Methods for Industrial Critical Systems . Springer Berlin Heidelberg. ISBN 978-3-642-41010-9 . Wikipedia revision 1353471089, retrieved 2026-11-18." Kriouile (16 September 2013). 2026-11-17. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.

    Chicago "Kriouile (16 September 2013). Formal Analysis of the ACE Specification for Cache Coherent Systems-on-Chip. In Formal Methods for Industrial Critical Systems . Springer Berlin Heidelberg. ISBN 978-3-642-41010-9 . Wikipedia revision 1353471089, retrieved 2026-11-18." Kriouile (16 September 2013). 2026-11-17. https://en.wikipedia.org/wiki/ISBN_(identifier).

    APA Kriouile (16 September 2013). (2026). Kriouile (16 September 2013). Formal Analysis of the ACE Specification for Cache Coherent Systems-on-Chip. In Formal Methods for Industrial Critical Systems . Springer Berlin Heidelberg. ISBN 978-3-642-41010-9 . Wikipedia revision 1353471089, retrieved 2026-11-18. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)

  4. AMBA | AMBA 5 · retrieved 2021-04-26 · rev 1353471089
    Cite this reference

    MLA "AMBA | AMBA 5." Ltd, Arm. 2021-04-26. https://developer.arm.com/architectures/system-architectures/amba/amba-5. Accessed 24 November 2026.

    Chicago "AMBA | AMBA 5." Ltd, Arm. 2021-04-26. https://developer.arm.com/architectures/system-architectures/amba/amba-5.

    APA Ltd, Arm. (2021). AMBA | AMBA 5. Retrieved November 24, 2026, from https://developer.arm.com/architectures/system-architectures/amba/amba-5

  5. Cache Coherence · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "Cache Coherence." Neupane, Mahesh (April 16, 2004). 2026-11-17. https://web.archive.org/web/20100620091706/http://cse.csusb.edu/schubert/tutorials/csci610/w04/MN_Cache_Coherence.pdf. Accessed 24 November 2026.

    Chicago "Cache Coherence." Neupane, Mahesh (April 16, 2004). 2026-11-17. https://web.archive.org/web/20100620091706/http://cse.csusb.edu/schubert/tutorials/csci610/w04/MN_Cache_Coherence.pdf.

    APA Neupane, Mahesh (April 16, 2004). (2026). Cache Coherence. Retrieved November 24, 2026, from https://web.archive.org/web/20100620091706/http://cse.csusb.edu/schubert/tutorials/csci610/w04/MN_Cache_Coherence.pdf

  6. A Unified Theory of Shared Memory Consistency · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "A Unified Theory of Shared Memory Consistency." Steinke, Robert C. 2026-11-17. https://en.wikipedia.org/wiki/ArXiv_(identifier). Accessed 24 November 2026.

    Chicago "A Unified Theory of Shared Memory Consistency." Steinke, Robert C. 2026-11-17. https://en.wikipedia.org/wiki/ArXiv_(identifier).

    APA Steinke, Robert C. (2026). A Unified Theory of Shared Memory Consistency. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ArXiv_(identifier)

  7. Patterson, David A.; Hennessy, John L. (1990). Computer Architecture A Quantitative Approach . Morgan Kaufmann Publishers. pp. 467– 468. ISBN 1-55860-069-8 . Wikipedia revision 1353471089, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "Patterson, David A.; Hennessy, John L. (1990). Computer Architecture A Quantitative Approach . Morgan Kaufmann Publishers. pp. 467– 468. ISBN 1-55860-069-8 . Wikipedia revision 1353471089, retrieved 2026-11-18." Patterson, David A. 2026-11-17. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.

    Chicago "Patterson, David A.; Hennessy, John L. (1990). Computer Architecture A Quantitative Approach . Morgan Kaufmann Publishers. pp. 467– 468. ISBN 1-55860-069-8 . Wikipedia revision 1353471089, retrieved 2026-11-18." Patterson, David A. 2026-11-17. https://en.wikipedia.org/wiki/ISBN_(identifier).

    APA Patterson, David A. (2026). Patterson, David A.; Hennessy, John L. (1990). Computer Architecture A Quantitative Approach . Morgan Kaufmann Publishers. pp. 467– 468. ISBN 1-55860-069-8 . Wikipedia revision 1353471089, retrieved 2026-11-18. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)

  8. Ravishankar, Chinya; Goodman, James (February 28, 1983). · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "Ravishankar, Chinya; Goodman, James (February 28, 1983)." 2026-11-17. https://www.cs.ucr.edu/~ravi/Papers/NWConf/ravishankar_83.pdf. Accessed 24 November 2026.

    Chicago "Ravishankar, Chinya; Goodman, James (February 28, 1983)." 2026-11-17. https://www.cs.ucr.edu/~ravi/Papers/NWConf/ravishankar_83.pdf.

    APA encyclopegia.org. (2026). Ravishankar, Chinya; Goodman, James (February 28, 1983). Retrieved November 24, 2026, from https://www.cs.ucr.edu/~ravi/Papers/NWConf/ravishankar_83.pdf

  9. a b Yan, Solihin. Fundamentals of parallel multicore architecture . OCLC 884540034 . Wikipedia revision 1353471089, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "a b Yan, Solihin. Fundamentals of parallel multicore architecture . OCLC 884540034 . Wikipedia revision 1353471089, retrieved 2026-11-18." a b Yan, Solihin. 2026-11-17. https://en.wikipedia.org/wiki/OCLC_(identifier). Accessed 24 November 2026.

    Chicago "a b Yan, Solihin. Fundamentals of parallel multicore architecture . OCLC 884540034 . Wikipedia revision 1353471089, retrieved 2026-11-18." a b Yan, Solihin. 2026-11-17. https://en.wikipedia.org/wiki/OCLC_(identifier).

    APA a b Yan, Solihin. (2026). a b Yan, Solihin. Fundamentals of parallel multicore architecture . OCLC 884540034 . Wikipedia revision 1353471089, retrieved 2026-11-18. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/OCLC_(identifier)

  10. a b E. Thomadakis, Michael (2011). The Architecture of the Nehalem Processor and Nehalem-EP SMP Platforms (PDF) . Texas A&M University. p. 30. Archived from the original (PDF) on 2014-08-11. Wikipedia revision 1353471089, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "a b E. Thomadakis, Michael (2011). The Architecture of the Nehalem Processor and Nehalem-EP SMP Platforms (PDF) . Texas A&M University. p. 30. Archived from the original (PDF) on 2014-08-11. Wikipedia revision 1353471089, retrieved 2026-11-18." a b E. 2026-11-17. https://web.archive.org/web/20140811023120/http://sc.tamu.edu/systems/eos/nehalem.pdf. Accessed 24 November 2026.

    Chicago "a b E. Thomadakis, Michael (2011). The Architecture of the Nehalem Processor and Nehalem-EP SMP Platforms (PDF) . Texas A&M University. p. 30. Archived from the original (PDF) on 2014-08-11. Wikipedia revision 1353471089, retrieved 2026-11-18." a b E. 2026-11-17. https://web.archive.org/web/20140811023120/http://sc.tamu.edu/systems/eos/nehalem.pdf.

    APA a b E. (2026). a b E. Thomadakis, Michael (2011). The Architecture of the Nehalem Processor and Nehalem-EP SMP Platforms (PDF) . Texas A&M University. p. 30. Archived from the original (PDF) on 2014-08-11. Wikipedia revision 1353471089, retrieved 2026-11-18. Retrieved November 24, 2026, from https://web.archive.org/web/20140811023120/http://sc.tamu.edu/systems/eos/nehalem.pdf

  11. a b Sorin, Daniel J.; Hill, Mark D.; Wood, David Allen (2011-01-01). A primer on memory consistency and cache coherence . Morgan & Claypool Publishers. OCLC 726930429 . Wikipedia revision 1353471089, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "a b Sorin, Daniel J.; Hill, Mark D.; Wood, David Allen (2011-01-01). A primer on memory consistency and cache coherence . Morgan & Claypool Publishers. OCLC 726930429 . Wikipedia revision 1353471089, retrieved 2026-11-18." a b Sorin, Daniel J. 2026-11-17. https://en.wikipedia.org/wiki/OCLC_(identifier). Accessed 24 November 2026.

    Chicago "a b Sorin, Daniel J.; Hill, Mark D.; Wood, David Allen (2011-01-01). A primer on memory consistency and cache coherence . Morgan & Claypool Publishers. OCLC 726930429 . Wikipedia revision 1353471089, retrieved 2026-11-18." a b Sorin, Daniel J. 2026-11-17. https://en.wikipedia.org/wiki/OCLC_(identifier).

    APA a b Sorin, Daniel J. (2026). a b Sorin, Daniel J.; Hill, Mark D.; Wood, David Allen (2011-01-01). A primer on memory consistency and cache coherence . Morgan & Claypool Publishers. OCLC 726930429 . Wikipedia revision 1353471089, retrieved 2026-11-18. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/OCLC_(identifier)

  12. a b c Patterson and Hennessy. Computer Organization and Design - 4th Edition . ISBN 978-0-12-374493-7 . Wikipedia revision 1353471089, retrieved 2026-11-18 · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "a b c Patterson and Hennessy. Computer Organization and Design - 4th Edition . ISBN 978-0-12-374493-7 . Wikipedia revision 1353471089, retrieved 2026-11-18." a b c Patterson and Hennessy. 2026-11-17. https://en.wikipedia.org/wiki/ISBN_(identifier). Accessed 24 November 2026.

    Chicago "a b c Patterson and Hennessy. Computer Organization and Design - 4th Edition . ISBN 978-0-12-374493-7 . Wikipedia revision 1353471089, retrieved 2026-11-18." a b c Patterson and Hennessy. 2026-11-17. https://en.wikipedia.org/wiki/ISBN_(identifier).

    APA a b c Patterson and Hennessy. (2026). a b c Patterson and Hennessy. Computer Organization and Design - 4th Edition . ISBN 978-0-12-374493-7 . Wikipedia revision 1353471089, retrieved 2026-11-18. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/ISBN_(identifier)

  13. Chapter 2 - Pitfalls and Issues of Manycore Programming · retrieved 2026-11-17 · rev 1353471089
    Cite this reference

    MLA "Chapter 2 - Pitfalls and Issues of Manycore Programming." Marowka, Ami (2010-01-01). 2026-11-17. https://linkinghub.elsevier.com/retrieve/pii/S0065245810790021. Accessed 24 November 2026.

    Chicago "Chapter 2 - Pitfalls and Issues of Manycore Programming." Marowka, Ami (2010-01-01). 2026-11-17. https://linkinghub.elsevier.com/retrieve/pii/S0065245810790021.

    APA Marowka, Ami (2010-01-01). (2026). Chapter 2 - Pitfalls and Issues of Manycore Programming. Retrieved November 24, 2026, from https://linkinghub.elsevier.com/retrieve/pii/S0065245810790021

Cite this article

MLA

"Cache coherence." encyclopegia.org, 2026, https://encyclopegia.org/wiki/cache-coherence. Accessed 24 November 2026.

Chicago

"Cache coherence." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/cache-coherence.

APA

encyclopegia.org. (2026). Cache coherence. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/cache-coherence

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

weak central coherence theory

stub · references available

coherence

stub · references available

Global Assembly Cache

stub · references available

optical coherence tomography

stub · references available

Windows thumbnail cache

stub · references available

Cache Creek

stub · references available

web cache

stub · references available

cache on a stick

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1353471089 · 0.5 · snapshot enwiki-001353471089

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.