From the course: Parallel and Concurrent Programming with Java 1

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Livelock

Livelock - Java Tutorial

From the course: Parallel and Concurrent Programming with Java 1

Start my 1-month free trial

Livelock

- Our greed and competition for sushi has led us to a life of deadlocks and starvation. There's only one piece of sushi left and I can see you're still hungry, you should have it. - Thank you my dear, but I can see you're still hungry too. And I would feel like a lousy husband if I allowed my wife to go hungry. You should have the last bite. - Oh but I can't bear to see you hungry, you shall have the final bite. - Well this is annoying. We've entered into another tricky situation known as a livelock. A livelock looks similar to a deadlock in the sense that two threads are blocking each other from making progress, but the difference is that the threads in a livelock are actively trying to resolve the problem. A livelock can occur when two or more threads are designed to respond to the actions of each other. Both threads are busy doing something, but the combination of their efforts prevent them from actually making progress and accomplishing anything useful. The program will never…

Contents