Deadlock
Presentation on
2
Submitted By:
1. Rup Chowdhury
ID: 201120010
2. Prapti Das
ID: 201120008
Submitted To:
Mostafiz Ahmed
Lecturer, Department of CSE
Notre Dame University Bangladesh
3
What is Deadlock?
Deadlock is a situation where a set of processes are
blocked because each process is holding a resource
and waiting for another resource acquired by some
other process.
A deadlock is a situation in which two computer
programs sharing the same resource are effectively
preventing each other from accessing the resource,
resulting in both programs ceasing to function.
4
Why Deadlock Occurs?
Deadlock occurs when a set of processes are in a wait
state, because each process is waiting for a resource that
is held by some other waiting process. Therefore, all
deadlocks involve conflicting resource needs by two or
more processes.
5
Traffic gridlock is an everyday example of a deadlock situation.
6
How Deadlock Occurs?
Deadlock can occur in a system if these 4 conditions satisfies in a system
simultaneously
1. Mutual Exclusion
2. Hold and Wait
3. No preemption
4. Circular Wait
7
Resource Allocation Graph
T1 T2 T3
R3
R1
R2
R4
Here, one instance of R3 is assigned to
T3. And T3 is not depending on
anyone. So after completing the
process the instance of R3 will be
freed.
T2 requested for R3. Now R3 is
free so it can be assigned to T2.
8
Resource Allocation graph with deadlock
T1 T2 T3
R3
R1
R2
R4
Deadlock!
9
T1
T2
T3
R1
R2
T4
Resource allocation graph with a cycle but no deadlock
10
Handling Deadlock
• Ignoring Deadlock
• Preventing or Avoiding Deadlock
• Let the system fall in Deadlock
11
Thanks!
Any questions?

Deadlock

  • 1.
  • 2.
    2 Submitted By: 1. RupChowdhury ID: 201120010 2. Prapti Das ID: 201120008 Submitted To: Mostafiz Ahmed Lecturer, Department of CSE Notre Dame University Bangladesh
  • 3.
    3 What is Deadlock? Deadlockis a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function.
  • 4.
    4 Why Deadlock Occurs? Deadlockoccurs when a set of processes are in a wait state, because each process is waiting for a resource that is held by some other waiting process. Therefore, all deadlocks involve conflicting resource needs by two or more processes.
  • 5.
    5 Traffic gridlock isan everyday example of a deadlock situation.
  • 6.
    6 How Deadlock Occurs? Deadlockcan occur in a system if these 4 conditions satisfies in a system simultaneously 1. Mutual Exclusion 2. Hold and Wait 3. No preemption 4. Circular Wait
  • 7.
    7 Resource Allocation Graph T1T2 T3 R3 R1 R2 R4 Here, one instance of R3 is assigned to T3. And T3 is not depending on anyone. So after completing the process the instance of R3 will be freed. T2 requested for R3. Now R3 is free so it can be assigned to T2.
  • 8.
    8 Resource Allocation graphwith deadlock T1 T2 T3 R3 R1 R2 R4 Deadlock!
  • 9.
  • 10.
    10 Handling Deadlock • IgnoringDeadlock • Preventing or Avoiding Deadlock • Let the system fall in Deadlock
  • 11.

Editor's Notes

  • #7 Mutual exclusion - Each resource is either currently allocated to exactly one process or it is available. (Two processes cannot simultaneously control the same resource or be in their critical section). Hold and Wait - processes currently holding resources can request new resources No preemption - Once a process holds a resource, it cannot be taken away by another process or the kernel. Circular wait - Each process is waiting to obtain a resource which is held by another process.
  • #8 This is a resource allocation graph. Where there are three threads. Here is 4 types of processes and 3 types of Threads or processes. To perform each process, different numbers of instances are needed. Here R3 is assigned to T3.