Open In App

Cache Coherence Protocols in Multiprocessor System

Last Updated : 23 Dec, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisite – Cache Memory 
In multiprocessor system where many processes needs a copy of same memory block, the maintenance of consistency among these copies raises a problem referred to as Cache Coherence Problem. 
This occurs mainly due to these causes:-

  • Sharing of writable data.
  • Process migration.
  • Inconsistency due to I/O.

Cache Coherence Protocols: 
These are explained as following below:

 1. MSI Protocol: 
This is a basic cache coherence protocol used in multiprocessor system. The letters of protocol name identify possible states in which a cache can be. So, for MSI each block can have one of the following possible states:

  • Modified – 
    The block has been modified in cache, i.e., the data in the cache is inconsistent with the backing store (memory). So, a cache with a block in “M” state has responsibility to write the block to backing store when it is evicted.
  • Shared – 
    This block is not modified and is present in atleast one cache. The cache can evict the data without writing it to backing store.
  • Invalid – 
    This block is invalid and must be fetched from memory or from another cache if it is to be stored in this cache.

2. MOSI Protocol: 
This protocol is an extension of MSI protocol. It adds the following state in MSI protocol:

  • Owned – 
    It indicates that the present processor owns this block and will service requests from other processors for the block.

3. MESI Protocol – 
It is the most widely used cache coherence protocol. Every cache line is marked with one the following states:

  • Modified – 
    This indicates that the cache line is present in current cache only and is dirty i.e its value is different from the main memory. The cache is required to write the data back to main memory in future, before permitting any other read of invalid main memory state.
  • Exclusive – 
    This indicates that the cache line is present in current cache only and is clean i.e its value matches the main memory value.
  • Shared – 
    It indicates that this cache line may be stored in other caches of the machine.
  • Invalid – 
    It indicates that this cache line is invalid.

4. MOESI Protocol: 
This is a full cache coherence protocol that encompasses all of the possible states commonly used in other protocols. Each cache line is in one of the following states:

  • Modified – 
    A cache line in this state holds the most recent, correct copy of the data while the copy in the main memory is incorrect and no other processor holds a copy.
  • Owned – 
    A cache line in this state holds the most recent, correct copy of the data. It is similar to shared state in that other processors can hold a copy of most recent, correct data and unlike shared state however, copy in main memory can be incorrect. Only one processor can hold the data in owned state while all other processors must hold the data in shared state.
  • Exclusive – 
    A cache line in this state holds the most recent, correct copy of the data. The main memory copy is also most recent, correct copy of data while no other holds a copy of data.
  • Shared – 
    A cache line in this state holds the most recent, correct copy of the data. Other processors in system may hold copies of data in shared state as well. The main memory copy is also the most recent, correct copy of the data, if no other processor holds it in owned state.
  • Invalid – 
    A cache line in this state does not hold a valid copy of data. Valid copies of data can be either in main memory or another processor cache.

Similar Reads

Cache Coherence
Prerequisite - Cache Memory Cache coherence : In a multiprocessor system, data inconsistency may occur among adjacent levels or within the same level of the memory hierarchy. In a shared memory multiprocessor with a separate cache memory for each processor, it is possible to have many copies of any one instruction operand: one copy in the main memo
4 min read
Difference between Loosely Coupled and Tightly Coupled Multiprocessor System
Loosely Coupled Multiprocessor System: It is a type of multiprocessing system in which, There is distributed memory instead of shared memory. In loosely coupled multiprocessor system, data rate is low rather than tightly coupled multiprocessor system. In loosely coupled multiprocessor system, modules are connected through MTS (Message transfer syst
2 min read
Multiport Memory Multiprocessor System
Multiport Memory System employs separate buses between each memory module and each CPU. A processor bus comprises the address, data and control lines necessary to communicate with memory. Each memory module connects each processor bus. At any given time, the memory module should have internal control logic to obtain which port can have access to me
1 min read
Multistage Switching Network - Interconnection structure in Multiprocessor System
In this article, we are going to cover the interconnection structure that is commonly used but in this section, we will more focus on Multistage Switching networks in detail. Let's discuss it one by one as follows. Overview :The processors must be able to share a set of main memory modules & I/O devices in a multiprocessor system. This sharing
4 min read
Time Shared Bus - Interconnection structure in Multiprocessor System
Interconnection structures :The processors must be able to share a set of main memory modules & I/O devices in a multiprocessor system. This sharing capability can be provided through interconnection structures. The interconnection structure that are commonly used can be given as follows - Time-shared / Common BusCross bar SwitchMultiport Memor
5 min read
Introduction of Multiprocessor and Multicomputer
1. Multiprocessor: A Multiprocessor is a computer system with two or more central processing units (CPUs) share full access to a common RAM. The main objective of using a multiprocessor is to boost the system’s execution speed, with other objectives being fault tolerance and application matching. There are two types of multiprocessors, one is calle
6 min read
Locality of Reference and Cache Operation in Cache Memory
Locality of reference refers to a phenomenon in which a computer program tends to access same set of memory locations for a particular time period. In other words, Locality of Reference refers to the tendency of the computer program to access instructions whose addresses are near one another. The property of locality of reference is mainly shown by
4 min read
Cache Memory in Computer Organization
Pre-Requisite: Computer Memory Cache Memory is a special very high-speed memory. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. There are various different independent caches in a CPU, which store instructions and data. The most important use of cache memory is that it is used to
7 min read
Multilevel Cache Organisation
Cache is a random access memory used by the CPU to reduce the average time taken to access memory. Multilevel Caches is one of the techniques to improve Cache Performance by reducing the "MISS PENALTY". Miss Penalty refers to the extra time required to bring the data into cache from the Main memory whenever there is a "miss" in the cache. For clear
5 min read
Difference between Virtual memory and Cache memory
Cache Memory: Cache memory increases the accessing speed of CPU. It is not a technique but a memory unit i.e a storage device. In cache memory, recently used data is copied. Whenever the program is ready to be executed, it is fetched from main memory and then copied to the cache memory. But, if its copy is already present in the cache memory then t
2 min read