Skip to content
Related Articles

Related Articles

Improve Article

Differentiate between Write Through and Write Back Methods

  • Last Updated : 04 Mar, 2021

Prerequisite – Write Through and Write Back in Cache 

During a read operation, when the CPU determines a word in the cache, the main memory is not included in the transfer. Thus, there are two ways that the system can proceed when the operation is a write. 

1. Write Through Method : The simplest method is to update the main memory with every memory write operation when the cache memory is updated in parallel when it contains the word at the specified address. This can be known as the write-through method. 

2. Write Back Method : 
During write operation, only the cache location is updated in the write-back method. Then, the location is marked by a flag so that it is later copied to the main memory when the word is removed from the cache. For the write-back method, the reason is that during the time a word remains in the cache, it can be updated multiple times. Thus, as long as the word remains in the cache, it does not matter if the copy in the main cache. This is only when the word is displaced from the cache which needs an exact copy that is rewritten into main memory. 

Differentiate Between Write Through and Write Back Methods :  



S.No.Write Through MethodWrite Back Method
1In this method main memory is updated with every memory write operation as well as cache memory is updated in parallel if it contains the word at the specified address.In this method only cache location is updated during write operation.
2Main memory always contains same data as cache.Main memory and cache memory may have different data.
3Number of memory write operation in a typical program is more.Number of memory write operation in a typical program is less
4When I/O device communicated through DMA would receive most recent data.When I/O device communicated through DMA would not receive most recent data.
5It is a process of writing cache and main memory simultaneously.It is a process of writing cache and data is removed from cache, first copied to main memory.

 

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :