CPUs and architecture
Which correctly describes the write-back policy for caches?
- AWrites skip the cache and update only main memory
- BEvery write always updates both the cache and main memory
- COnly the cache is updated at first, and the data is written back to main memory when it is evicted from the cache
Show answer and explanation
Answer: C. Only the cache is updated at first, and the data is written back to main memory when it is evicted from the cache
In write-back, writes go only to the cache, and modified (dirty) lines are written back to main memory when evicted. This reduces main-memory accesses and is fast, but makes coherence management more complex. Updating both every time is write-through.
- A. This describes writing without using the cache.
- B. Updating both cache and memory every time is write-through.
- C. Correct. Data is written back to main memory on eviction.