Previous | Next --- Slide 37 of 64
Back to Lecture Thumbnails
acortes

What is another example of livelock?

amolakn

I just want to clarify. Is this saying that P1 issued a BusRdX, P2 invalidated cache line B, and BEFORE P1 finishes its BusRdX and has obtained exclusive ownership P2 claims a BusRdX of its own immediately invalidating P1's cache line B? If this is the case, wouldn't P1's original BusRdX eventually finish and end the livelock?

Also, is the solution suggesting that when P1 performs the BusRdX it should be allowed to complete and become exclusive owner before P2 can perform its own BusRdX? Or is it saying that when P1 performs the BusRdX it should complete and become exclusive owner before P2 invalidates?

gogogo

@acortes this is a good example of the concept of livelock: http://stackoverflow.com/questions/1036364/good-example-of-livelock

ferozenaina

@acortes A livelock is pretty similar to a deadlock but both the processors/threads appear to be performing work by changing internal states without making any actual progress.

The example I have in mind is 2 threads and two locks. Each thread has a loop inside to capture both locks. Thread 0 had lock 0 and is unable to capture lock 1 so it releases lock 0. Thread 1 is doing the same with lock 1.

Here, both the threads keep capturing and releasing a single lock (state changes) but no real execution progress is made since both the locks are not captured by a single thread at any instance.