- Asked 4/19
- 2073 Bhadra · 4 marks
- 2070 Bhadra · 3 marks
- 2075 Bhadra · 2 marks
- 2078 Chaitra
Deadlock and Coffman conditions
Short answer
Deadlock is a cycle of tasks each holding a resource and waiting for another held within the set. The four necessary Coffman conditions are mutual exclusion, hold-and-wait, no preemption, and circular wait. All must hold for deadlock to occur.
Define deadlock and explain the Coffman conditions (conditions favoring deadlock).
A deadlock is a situation in which two or more tasks (processes) are each waiting for a resource held by another in the set, so none of them can proceed. Example: task T1 holds resource R1 and waits for R2, while T2 holds R2 and waits for R1.
T1 --holds--> R1 <--waits-- T2
T1 --waits--> R2 --held by-- T2
Coffman conditions
Deadlock can occur only if all four hold at the same time:
- Mutual exclusion: at least one resource can be used by only one task at a time (non-shareable).
- Hold and wait: a task holds at least one resource while waiting for additional resources held by others.
- No pre-emption: a resource cannot be forcibly taken from a task; the task must release it voluntarily.
- Circular wait: there is a closed chain of tasks, each waiting for a resource held by the next one in the chain.
Handling: prevent by removing any one condition (e.g. request all resources at once, impose a resource ordering), avoid (Banker's algorithm), detect and recover, or ignore.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Deadlock and its conditions · Microprocessor, chapter 6 · asked 2×
- Deadlock; necessary conditions with examples · Operating System, chapter 7
- Deadlock conditions; Banker's with 4 processes · Operating System, chapter 7
- Deadlock conditions and why all necessary · Operating System, chapter 7