Questions: Cache Write-Through and Write-Back Policies

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A program writes to the same memory address 200 times in a tight loop, and the cache line containing that address is never evicted during the loop. How many writes reach main memory under write-back vs. write-through?

AWrite-back: 200 writes; Write-through: 1 write
BWrite-back: 1 write (on eviction); Write-through: 200 writes
CBoth policies generate 200 writes to main memory
DWrite-back: 0 writes; Write-through: 200 writes (write-back never touches main memory)
Question 2 Multiple Choice

In a multiprocessor system, why does write-back require explicit cache coherence protocols (like MESI), while write-through is simpler to keep consistent?

AWrite-back caches are physically farther from main memory in multiprocessor layouts
BWith write-through, every store propagates to main memory immediately so other cores can observe writes by snooping the memory bus; with write-back, modified data may reside only in one core's cache, invisible to others
CWrite-through uses dirty bits that must be coordinated across all caches, while write-back does not
DWrite-back generates more total memory traffic, making coherence harder to track
Question 3 True / False

A dirty bit in a write-back cache indicates that the cache line contains data that has been modified and differs from the corresponding value in main memory.

TTrue
FFalse
Question 4 True / False

Write-through caches are generally faster than write-back caches because keeping main memory up to date avoids the overhead of writing back dirty lines on eviction.

TTrue
FFalse
Question 5 Short Answer

Explain the role of the dirty bit in a write-back cache. What happens when a dirty cache line is evicted, and why does write-back require this mechanism while write-through does not?

Think about your answer, then reveal below.