Deadlocks, Detecting and Recovering From Deadlocks
Deadlocks, Detecting and Recovering From Deadlocks
RECOVERING FROM
DEADLOCKS
Presented by: group 3 (Muskan 32, Alishfa 10, Haseeb 29,
Amir saleem 26, Saqlain 31, Rayan 14)
Submitted to: Mam Hamna Khalid
Context:
■ Introduction to Deadlock
■ Necessary Conditions for Deadlock
■ Methods for Handling Deadlock (Prevention and Avoidance)
■ Methods for Handling Deadlock (Detection and Recovery)
■ Recovery from Deadlock (Process Termination)
■ Recovery from Deadlock (Resource Preemption) and
Deadlock Ignorance
Introduction to Deadlock:
1. No Preemption
2. Circular Wait
3. Hold and Wait
4. Mutual Exclusion
Necessary Conditions for Deadlock
No Preemption
Circular Wait
Hold and wait is one of the conditions that can lead to deadlock in an
operating system. It occurs when a process holds at least one resource
and is waiting to acquire additional resources that are currently held by
other processes. This situation creates the potential for deadlock
because processes may end up waiting indefinitely for resources to
become available, while still holding onto resources they have
acquired.
Necessary Conditions for Deadlock
Mutual Exclusion
Prevention:
The idea is to not let the system into a deadlock state. This system will make
sure that above mentioned four conditions will not arise. These techniques are very
costly so we use this in cases where our priority is making a system deadlock-free.
One can zoom into each category individually, Prevention is done by negating one of
the above-mentioned necessary conditions for deadlock. Prevention can be done in
four different ways:
1. Manual Intervention:
When a deadlock is detected, one option is to inform the operator and let
them handle the situation manually. While this approach allows for human
judgment and decision-making, it can be time-consuming and may not be
feasible in large-scale systems.
2. Automatic Recovery: