Deadlock
In computer science, particularly in the context of operating systems and concurrent programming, a deadlock is a state in which two or more processes are unable to proceed because each is waiting for one or more of the others to release a resource.[1][2]This situation arises when processes hold resources while waiting for others, creating a circular dependency that prevents progress. Deadlocks are a critical issue in multiprogramming environments, where multiple processes compete for shared resources such as memory, files, or hardware devices.[3][4]
The occurrence of deadlock requires the simultaneous presence of four conditions: mutual exclusion (resources cannot be shared), hold and wait (processes hold resources while waiting for others), no preemption (resources cannot be forcibly taken), and circular wait (a cycle of processes each waiting for the next).[1][5]
Addressing deadlocks involves strategies like prevention, avoidance, detection, and recovery, each with trade-offs in system performance and complexity.[6]