2. Outline
• What is Deadlock?
• Resource Utilization
• Deadlock Characterization
• Methods For Handling Deadlock
• Conclusion
2
3. What is Deadlock?
• A set of blocked processes each holding a resource and
waiting to acquire a resource held by another process in the
set.
• Example
• System has 2 disk drives.
• P1 and P2 each hold one disk drive and each needs another one.
3
4. Resource Utilization
Under the normal mode of operation, Each process may
utilizes a resource in following sequence:
• Request
• Use
• Release
4
5. Deadlock Characterization
Deadlock can arise if four
conditions hold
simultaneously.
• Mutual exclusion: only one
process at a time can use a
resource.
• Hold and wait: a process
holding at least one resource
is waiting to acquire
additional resources held by
other processes.
5
6. • No pre-emption: a resource
can be released only voluntarily
by the process holding it, after
that process has completed its
task.
• Circular wait: there exists a set
{P0, P1, …, P0} of waiting
processes such that P0 is
waiting for a resource that is
held by P1, P1 is waiting for a
resource that is held by P2, …,
Pn–1 is waiting for a resource
that is held by Pn, and Pn is
waiting for a resource that is
held by P0.
6
7. Methods For Handling Deadlock
We can deal with Deadlock problem in 3-ways:
• Prevention/Avoidance
• Ensure that the system will never enter a deadlock state.
• Detection/Correction
• Allow system to enter a deadlock state and then recover.
• Ignorance
• Ignore problem and pretend that deadlock never occur.
• Used by most operating systems, including UNIX.
7
8. Conclusion
8
• Deadlock occurs when a process waiting for resources that are
held by another process. To resolve this deadlock condition
some algorithms like Banker’s algorithm(Avoidance
algorithm), Safety Algorithm(Avoidance algorithm), Detection
algorithm, Ostrich algorithm etc. are helpful.