Definition
Deadlock Recovery
Strategies
Process Termination
Abort all deadlocked processes: Simplest but most expensive; all progress is lost.
Abort one at a time: Sequentially abort processes and rerun detection until deadlock clears.
Selection criteria:
- Least CPU time consumed
- Fewest resources held
- Lowest priority
Resource Preemption
Preempt resources: Forcibly take resources from deadlocked processes and assign them to others until the cycle breaks.
Rollback: To avoid inconsistent states, the victim must be rolled back to a previous checkpoint.
Starvation prevention: Ensure the same process is not repeatedly chosen as the victim.
Integrated Strategy
Integrated Strategy
Most operating systems combine strategies tailored to resource classes: preemption for memory, avoidance for complex I/O devices.