Previous | Next --- Slide 17 of 51
Back to Lecture Thumbnails

In this slide, I'm not clear why presence[1] and presence[2] in processor 1's directory are cleared. To me, it seems that it assumes the subsequent invalidation will be a success. But what if the invalidation is not successful? Should we wait until successful invalidation to clear presence[1] and presence[2]?


@haboric.Yes, your concern is right. There is also a bad case: before processor 0 tell processor 2 to drop the line, processor 2 request write to the same cache line, too. Then processor 2 would tell processor 0 to drop this line. Now, both of p0 and p2 will get drop message.

So we should design this protocol to prevent bad things happen. For example, we could add a write lock, so that only one processor can request write operation. And for your case, maybe we can let processor 0 request drop again if not successful.


@haboric. The diagram is correct.

P1 and P2 have the line valid in the read state. P0 will not write until it knows the invalidations have taken place. This is step 4.

Clearing the P1 and P2 presence bits immediately in the directory is fine. Consider what might happen if P2 attempts to write prior to receiving the message that it needs to invalidate. It will see P0 has the line, and send a message to invalidate P0.

However, P0 knows it's still waiting on the "I've invalidated" ack from P2 to finish off its own previous write. P0 will wait for this ack before dropping the line to satisfy P2's request to write. This is important, otherwise, you'll end up in a livelock situation as discussed on this slide.


@kayvonf Why not let the home node do the invalidation stuff, as it knows which request comes first (if there is a tie, it is able to break it).