Deadlock Avoidance
Deadlock avoidance allows the three necessary conditions (mutual exclusion, hold and wait, no preemption) but makes judicious choices to assure that the deadlock point is never reached.
Two approaches:
- Do not start a process if its demands might lead to deadlock
- If the sum of all requested resources exceeds the resource budget, then don’t admit the process
- Do not grant an incremental resource request to a process if this allocation might lead to deadlock
For first approach: A process is only started if the maximum claim of all current processes plus those of the new process can be met.
For second approach: Use the Banker’s Algorithm