In the context of computer architecture, what is the primary purpose of a cache's 'write buffer'?
A write buffer is a small, fast memory queue placed between the CPU/cache and main memory. When a write operation occurs that needs to go to main memory (e.g., a write-miss in a write-allocate cache, or any write in a write-through cache), the data is written to the write buffer first. This is a very fast operation, allowing the processor to proceed with subsequent instructions immediately, instead of waiting (stalling) for the much slower write to main memory to complete. The write buffer then drains its contents to main memory in the background.