What are the different ways in which writing into the cache be done? - Computer architecture and design
What are the different ways in which writing into the cache be done?
- There are two different ways in which cache can be written one is the Write through method and the other is the write back method.
- Write through method: Considered to be the simplest this method involves the updating of the main memory corresponding to every write operation. With this the cache memory is also updated in parallel in case it also contains the word specified at the address. The primary advantage of this method is data integrity, the primary and the cache memory both contain the same data.
- Write back method: In this method only the location in the cache is updated. Whenever such an update occurs a flag is set which makes sure that in case the word is removed from the cache the correct copy is saved to the main memory. This approach is usually taken when a word is constantly updated at frequent intervals.