Deadlock is a situation in concurrent computing where two or more processes (or threads) are unable to proceed with their execution because each is waiting for a resource that can only be released by another blocked process.
In other words, it’s a circular waiting condition where processes are stuck and cannot make progress.
Characteristics of Deadlock:
Mutual Exclusion: At least one resource is non-shareable, meaning only one process can use it at a time. This characteristic leads to contention for the resource and potential deadlock.
Hold and Wait: A process holds at least one resource while waiting to acquire additional resources that are currently held by other processes. The process is unwilling to release its held resources while waiting for the missing ones.
No Preemption: Resources cannot be forcibly taken away from a process; they can only be released voluntarily by the process holding them.
Circular Wait: There exists a circular chain of two or more processes, each holding a resource that the next process in the chain is waiting for. This circular dependency prevents any process in the chain from proceeding.