Nepedia
Back to Discover
Fluent Reader
💻

Cache coherence

technology Maturity 7-9 Next article →

Computers often use many processors at once to work faster. Each processor can have its own local storage called a cache. This cache holds copies of data from the main memory.

Non Coherent
Non Coherent

Cache coherence is the way a system keeps all these copies the same. If one processor changes a piece of data, all other copies must change too. Without this, different processors might see different values for the same thing. This mismatch can cause big errors in how the computer works.

Non Coherent
Non Coherent

To stay coherent, a system must follow two main rules. The first rule is called write propagation. This means any change made in one cache must be sent to all other copies. The second rule is called transaction serialization. This ensures that all processors see changes to the same data in the same order. Imagine if two people changed a number. One person changes it to 10, and another changes it to 20. Every processor must see those changes in that exact sequence. If some see 10 then 20, while others see 20 then 10, the system is incoherent.

There are two common ways to manage this process. The first way is called snooping. In a snooping system, each cache monitors the data lines to watch for changes. This is a fast method if there is enough bandwidth. However, it is hard to grow because every request must be sent to every processor. The second way is called directory-based. This uses a central directory to keep track of which caches hold which data. The directory acts like a filter for the processors. It tells them when they can load or change data.

Cache coherence
Cache coherence

Different protocols use different methods to handle these updates. In a write-invalidate protocol, a cache simply throws away its old copy when it sees a change. This forces the processor to get the new value from the main memory later. In a write-update protocol, the system actually sends the new data to update the other caches immediately. Many different types of protocols exist, such as MSI, MESI, and Dragon. In 2011, a company called ARM Ltd proposed the AMBA 4 ACE for handling this in specific computer chips. They also created the AMBA CHI specification for connecting fully coherent processors.

Understanding cache coherence helps us see how complex computers stay organized. It is like a group of friends sharing a single notebook. If one friend writes a new note, everyone else needs to know what it says. They must also agree on which note was written first. This keeps everyone on the same page. In a computer, this happens billions of times every second. It allows many processors to work together on one big task without getting confused.

Non Coherent
Non Coherent
454 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (3)
File:Cache coherence.svg
Cache coherence.svg
File:Non Coherent.gif
Non Coherent.gif
File:Coherent.gif
Coherent.gif
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.