If we call the run function repeatedly with different

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ACHE MEMORIES 319 The situation for writes is a little more complicated. Suppose the CPU writes a word Û that is already cached (a write hit). After the cache updates its copy of Û, what does it do about updating the copy of Û in memory? The simplest approach, known as write-through, is to immediately write Û’s cache block to memory. While simple, write-through has the disadvantage of causing a write transaction on the bus with every store instruction. Another approach, known as write-back, defers the memory update as long as possible by writing the updated block to memory only when it is evicted from the cache by the replacement algorithm. Because of locality, write-back can significantly reduce the number of bus transactions, but it has the disadvantage of additional complexity. The cache must maintain an additional dirty bit for each cache line that indicates whether or not the cache block has been modified. Another issue is how to deal with write misses. One approach, known as write-allocate, loads the corresponding memory block into the cache and then updates the cache block. Write-allocate tries to exploit spatial locality of writes, but h...
View Full Document

Ask a homework question - tutors are online