Cache Consistency: what is it?

Print anything with Printful



Cache consistency is a problem in multiprocessor computers where each processor has its own cache. Directory-based consistency, snooping, and snarfing are methods used to prevent cache consistency loss. Directory-based consistency is slower but practical for large-scale applications, while snooping is faster and suitable for systems with few processors. Snarfing is not commonly used due to its resource-intensive nature.

Cache consistency is the natural problem that develops when multiple agents access and modify a system’s data set. The main area of ​​computer architecture where this becomes a problem is in multiprocessor computers. Each processor in a multiprocessor computer has its own cache which loads and stores information from random access memory (RAM). When two processors access the same area of ​​memory, cache coherence would be lost if certain precautions were not taken.

Without cache coherence, a multiprocessor system would not be able to function. There are several methods that have been developed to deal with this problem and avoid potential problems. Directory-based consistency, snooping and snarfing are three methods used to prevent cache consistency loss.

Directory-based consistency acts as a filter to ensure consistency. The data is stored in a portion of memory accessible to all processors. When the information stored in that area of ​​memory changes, the system will either update the caches or invalidate them.

Snooping requires the processor to monitor all accesses to memory locations that have been cached. This lets the processor know when a write operation has occurred. By knowing when a write operation occurs, the processor can update its cache.

Snarfing is quite similar to snooping. Snarfing involves not only monitoring accesses to memory locations that have been cached, but also monitoring the actual information stored in memory. When a memory write occurs, the cache can be updated with the new information.

Directory-based consistency systems have relatively high latency, resulting in slower processing. Lower bandwidth requirements allow directory-based consistency systems to be practical in large-scale cache consistency applications. The more processors a system uses, the more benefit it can get from using a directory-based consistency system.
Snooping is a much faster method. This method requires more bandwidth than the directory-based approach. This method can be used effectively in systems that have relatively few processors.
Snarfing is not usually used as a method of maintaining cache consistency. This is mainly because snarfing is more resource intensive than snooping and directory-based methods. For a snarfing system to work, it must keep track of both memory addresses and the data stored in those memory areas. The amount of bandwidth and processing consumed by this method makes maintaining cache coherence undesirable for most applications.




Protect your devices with Threat Protection by NordVPN


Skip to content