Memory Hierarchy
What is the main purpose of a write buffer in a write-through cache?
- ATo let the CPU continue without waiting for writes to main memory to complete
- BTo keep the data in the cache newer than in main memory
- CTo always fetch the line from main memory into the cache first on a write miss, then write it
Show answer and explanation
Answer: A. To let the CPU continue without waiting for writes to main memory to complete
A write-through cache also writes to main memory on every store, so waiting for each write to finish would stall the CPU constantly. A write buffer holds writes temporarily, letting the CPU move on immediately while the buffer drains to memory in the background. Keeping the cache newer than memory characterizes write-back caches; with write-through the two stay consistent. Whether to load a line on a write miss is the write-allocate decision, separate from the write buffer.
- A. Correct. It holds writes temporarily so the CPU need not wait.
- B. The cache becomes newer than memory under write-back.
- C. Loading on a miss is the write-allocate decision.