Java / Java Multithreading
What is livelock in multithreading?
A thread often acts in response to the action of another thread. If the other thread's action is also a response to the action of another thread, then livelock may result.
It is a recursive situation where two or more threads would keep repeating a particular code logic. The intended logic is typically giving opportunity to the other threads to proceed in favor of current thread.
A real-world example of livelock occurs when two people meet in a narrow corridor, and each tries to be polite by moving aside to let the other pass, but they end up blocking each other from side to side without making any progress because they both repeatedly move the same way at the same time.
More Related questions...