Definition
Deadlock Prevention
Deadlock prevention is an approach to managing deadlocks by designing the operating system or its resource-allocation protocols such that at least one of the four Coffman conditions is guaranteed to never hold.
Deadlock prevention strategies are divided into two categories:
- Indirect Deadlock Prevention: Aims to invalidate the static system properties (Mutual Exclusion, Hold and Wait, or No Preemption).
- Direct Deadlock Prevention: Specifically targets and prevents the formation of a circular wait.
Summary of Techniques
| Condition | Prevention Method |
|---|---|
| Mutual Exclusion | Use spooling for non-shareable resources. |
| Hold and Wait | Request all resources simultaneously. |
| No Preemption | Allow the OS to reclaim resources from blocked processes. |
| Circular Wait | Enforce a strict linear ordering of resource types. |