Deadlocks in Operating Systems. Harsh Patle Roll No: 47.
What is a Deadlock?. 2. P1. R1. R2. P2. held by P1.
Necessary Conditions. 3. 1. Mutual exclusion Resource can be used by only one process at a time.
Deadlock Detection. 4. Resource Allocation Graph.
Deadlock Avoidance. 5. Safe state A safe sequence of all processes exists.
Deadlock Prevention. 6. Ensure at least one of the four necessary conditions can never hold..
Recovery & Summary. 7. Recovery from deadlock. Process termination Abort all deadlocked processes Abort one at a time until cycle breaks Resource preemption Select a victim (minimize cost) Rollback to a safe state Prevent starvation of the victim.