Back to Courses

Interview Preparation · Operating Systems

The four conditions for deadlock

Explanation

Deadlock can occur only if all four hold together: mutual exclusion, hold and wait, no preemption, and circular wait. Breaking any one prevents deadlock.

Example

Ordering all locks globally removes circular wait.