Problem regarding Write-Through and Write-Back Caches.

Asked By 20 points N/A Posted on -
qa-featured

What is the difference between Write – Through and Write – Back Caches? 

Can you explain advantages and disadvantages of each.

SHARE
Best Answer by Sharath Reddy
Answered By 0 points N/A #116362

Problem regarding Write-Through and Write-Back Caches.

qa-featured

These are the following differences:

In Write through – Write is done synchronously both to the cache and to the backing store. While in Write-back. Writing is done only to the cache. Before it is replaced a modified cache block is written back to the store first. It is also called write behind.
 
Write through is better in integrity as it will flush for each writes. While, Write back holds up the write till the same cache line has to be used up for a read, which question the data integrity when multiple processors access the same region of data using its own internal cache.
 
Write Through – Doesn't give this performance compared to the write-back.
 
While, Write Back – gives a good performance, as it save many memory write cycles /write.
 
Best Answer
Best Answer
Answered By 590495 points N/A #116363

Problem regarding Write-Through and Write-Back Caches.

qa-featured

cache is a block of memory in the computer that stores data temporarily for a faster data transfer. If the requested data is present in the cache, the data is served much faster by simply reading it from the cache and it is what they call “cache hit”. It is termed as hit because the data was found in the cache. But, on the contrary, not all data requests are present in the cache. Most of the time when you do multi-tasking where you open and close several applications the data request is not present in the cache.

When this happens, the data will be fetched directly from the original source which is from the hard drive and then finally served and this slows the process. This is what they call “cache miss” because the data is missing from the cache. The manner of writing data to the cache is controlled by write policy. When the system writes data to the cache, the data must also be written to the backing store at some point and this is what the write policy is handling. Write-through and write-back [write-behind] are the 2 fundamental methods of writing.

In write-through, data is written both to the cache and to the backing store simultaneously. In write-back, data is written only to the cache at the start. Data is not yet written to the backing store. It will wait for the time when the cache blocks that contains the data is about to be modified or be replaced by new content.

 

Related Questions