Livelock
Livelock is a state in concurrent computing where multiple processes are active but make no forward progress because they are continuously changing their states in response to each other without resolving the underlying problem. Unlike a deadlock, where processes are completely blocked, livelock processes are busy, often consuming CPU resources, but remain stuck in a cycle. A common analogy is two people in a narrow hallway repeatedly sidestepping to let the other pass, only to end up moving the same way at the same time, blocking each other indefinitely.
How it happens
Over-politeness: Two processes repeatedly back off from each other to be helpful, but both back off at the same time, preventing either from proceeding.
Resource contention: Processes might repeatedly try to acquire a resource, find it unavailable, and then release it, only to try again, entering an endless cycle.
Faulty recovery mechanisms: A system designed to recover from a deadlock might repeatedly retry in a way that causes a livelock if multiple processes take action simultaneously.
Improper scheduling: A scheduler might repeatedly switch between processes in a way that none of them can complete their task.