Electrical – Which cache type is better for bus watching

buscachememory

I am studying for an exam about memory (mostly cache) and I ran across a multiple-choice question from a few years back:

Which cache type is recommended for bus watching and is also used in multiprocessor systems?

 a. write-through cache
 b. write-back cache

I understand that bus watching means that each cache snoops the bus to see what requests are sent form other caches to the main memory, but I don't really understand which answer is correct.

First type (write-through) would just update everything to the memory every time something is updated and the latter would just keep data in cache to be faster and to me it seems that both could work.

Any help is appreciated.

Best Answer

Obviously on a multiprocessor system a write-back cache is impossible to use. The write-back cache only updates the data in the cache and not in the memory. The update on the memory is done only when the data on the cache is to be evicted. Let's say that two processors have the same memory address mirrored on their respective caches. Each one of them decides to change the cache contents. Here starts the problem, there are two different data for the same memory addresses. Hence it is impossible to use write-back caches for multi-processor system unless additional mechanisms are added to ensure cache coherency between the different processors of the multiprocessor system.