SlideShare a Scribd company logo
Unit 3 – Part 1
Deadlock
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.
Consider an example when two trains are coming toward
each other on same track and there is only one track,
none of the trains can move once they are in front of
each other. Similar situation occurs in operating systems
when there are two or more processes hold some
resources and wait for resources held by other(s). For
example, in the below diagram, Process 1 is holding
Resource 1 and waiting for resource 2 which is acquired
by process 2, and process 2 is waiting for resource 1.
Unit 3 part 1(DEADLOCK)
Deadlock can arise if following four
Coffman Conditions
A deadlock occurs if the four Coffman conditions
hold true. But these conditions are not mutually
exclusive.
The Coffman conditions are given as follows
• Mutual Exclusion
• Hold and Wait
• No Preemption
• Circular Wait
Mutual Exclusion
There should be a resource that can only be held by one
process at a time. In the diagram below, there is a single
instance of Resource 1 and it is held by Process 1 only.
The resources involved are non-shareable
Explanation: At least one resource (thread) must be held
in a non-shareable mode. that is, only one process at a
time claims exclusive control of the resource.
If another process requests that resource, the requesting
process must be delayed until the resource has been
released.
Hold and Wait
A process can hold multiple resources and still
request more resources from other processes which
are holding them. In the diagram given below,
Process 2 holds Resource 2 and Resource 3 and is
requesting the Resource 1 which is held by Process 1.
No Preemption
A resource cannot be preempted from a process by force.
A process can only release a resource voluntarily. In the
diagram below, Process 2 cannot preempt Resource 1
from Process 1. It will only be released when Process 1
give it up voluntarily after its execution is complete.
Circular Wait
A process is waiting for the resource held by the
second process, which is waiting for the resource
held by the third process and so on, till the last
process is waiting for a resource held by the first
process. This forms a circular chain. For example:
Process 1 is allocated Resource2 and it is requesting
Resource 1. Similarly, Process 2 is allocated Resource
1 and it is requesting Resource 2. This forms a
circular wait loop.
As an example, consider the traffic
deadlock in the following figure
Consider each section of the street as a resource.
• Mutual exclusion condition applies, since only one
vehicle can be on a section of the street at a time.
• Hold-and-wait condition applies, since each vehicle is
occupying a section of the street, and waiting to move
on to the next section of the street.
• No-preemptive condition applies, since a section of the
street that is a section of the street that is occupied by a
vehicle cannot be taken away from it.
• Circular wait condition applies, since each vehicle is
waiting on the next vehicle to move. That is, each
vehicle in the traffic is waiting for a section of street
held by the next vehicle in the traffic.

More Related Content

PPTX
Circular wait - Operating Systems
Omair Imtiaz Ansari
 
PPTX
deadlock acoidence and prevention .pptx
Siddu Rk
 
PPTX
Deadlockproj.pptx
sonu642319
 
PPTX
deadlocks in operating .pptx
MuhammadAdeelMuhamma3
 
PPTX
DEADLOCKPrevention in process management.pptx
ezekielnyamu1
 
PPTX
Unit iv: Deadlocks
Arnav Chowdhury
 
PDF
The Semaphore and Deadlock concept -os.pdf
Stella526835
 
Circular wait - Operating Systems
Omair Imtiaz Ansari
 
deadlock acoidence and prevention .pptx
Siddu Rk
 
Deadlockproj.pptx
sonu642319
 
deadlocks in operating .pptx
MuhammadAdeelMuhamma3
 
DEADLOCKPrevention in process management.pptx
ezekielnyamu1
 
Unit iv: Deadlocks
Arnav Chowdhury
 
The Semaphore and Deadlock concept -os.pdf
Stella526835
 

Similar to Unit 3 part 1(DEADLOCK) (20)

PPTX
Deadlockpresentation.pptx
KARMVIR6
 
PPTX
UNIT-3 DEADLOCK PART-1 08-06-2022 (1).pptx
vaishnavid3111
 
PPTX
4.3 Deadlock [Autosaved].pptx
DishaDwivedi2
 
PPTX
OS Unit 3.pptx
GautamBorana
 
PPTX
3.6 Deadlock-operating system unit 3.pptx
svulasal
 
PPTX
Deadlock
Lutfullah Haqnesar
 
PPTX
DEADLOCK
Himanshu Lachhwani
 
PPTX
Deadlocks by wani zahoor
Wani Zahoor
 
PPT
Deadlock in operating systems
jamunaashok
 
PPTX
Ch 4 deadlock
madhuributani
 
PPTX
Deadlocks
Zahid Ali
 
DOCX
deadlock-operating-systems (1jjhkh).docx
Dpak Chavan
 
PPTX
OS deadlock.pptx
rpbbhalerao2000
 
DOCX
AS1- Four Condition of Deadloc- show that the four conditions of deadl.docx
james876543264
 
PPT
Deadlocks.ppt
jamilmalik19
 
PDF
OPERATING SYSTEM deadlock prevention techniques
07AIMLTINADALVI
 
PPTX
Deadlock detection & prevention
IkhtiarUddinShaHin
 
PPT
Deadlocks dhsidhcc ISIxnac bdbckjncmzczjkbc
sanjeetbhai2024
 
PDF
Deadlock_Operating system presentation .pdf
ankitashah871482
 
Deadlockpresentation.pptx
KARMVIR6
 
UNIT-3 DEADLOCK PART-1 08-06-2022 (1).pptx
vaishnavid3111
 
4.3 Deadlock [Autosaved].pptx
DishaDwivedi2
 
OS Unit 3.pptx
GautamBorana
 
3.6 Deadlock-operating system unit 3.pptx
svulasal
 
Deadlocks by wani zahoor
Wani Zahoor
 
Deadlock in operating systems
jamunaashok
 
Ch 4 deadlock
madhuributani
 
Deadlocks
Zahid Ali
 
deadlock-operating-systems (1jjhkh).docx
Dpak Chavan
 
OS deadlock.pptx
rpbbhalerao2000
 
AS1- Four Condition of Deadloc- show that the four conditions of deadl.docx
james876543264
 
Deadlocks.ppt
jamilmalik19
 
OPERATING SYSTEM deadlock prevention techniques
07AIMLTINADALVI
 
Deadlock detection & prevention
IkhtiarUddinShaHin
 
Deadlocks dhsidhcc ISIxnac bdbckjncmzczjkbc
sanjeetbhai2024
 
Deadlock_Operating system presentation .pdf
ankitashah871482
 
Ad

More from WajeehaBaig (6)

PDF
File system
WajeehaBaig
 
PDF
Unit 3 part 2(DEADLOCK)
WajeehaBaig
 
PDF
Unit 2 part 2(Process)
WajeehaBaig
 
PDF
Unit 2 part 1(Process)
WajeehaBaig
 
PDF
lecture 1 (Part 2) kernal and its categories
WajeehaBaig
 
PDF
lecture 1 (Introduction to Operating System.)
WajeehaBaig
 
File system
WajeehaBaig
 
Unit 3 part 2(DEADLOCK)
WajeehaBaig
 
Unit 2 part 2(Process)
WajeehaBaig
 
Unit 2 part 1(Process)
WajeehaBaig
 
lecture 1 (Part 2) kernal and its categories
WajeehaBaig
 
lecture 1 (Introduction to Operating System.)
WajeehaBaig
 
Ad

Recently uploaded (20)

PDF
STUDY OF NOVEL CHANNEL MATERIALS USING III-V COMPOUNDS WITH VARIOUS GATE DIEL...
ijoejnl
 
PDF
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
STUDY OF NOVEL CHANNEL MATERIALS USING III-V COMPOUNDS WITH VARIOUS GATE DIEL...
ijoejnl
 
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 

Unit 3 part 1(DEADLOCK)

  • 1. Unit 3 – Part 1 Deadlock
  • 2. 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. Consider an example when two trains are coming toward each other on same track and there is only one track, none of the trains can move once they are in front of each other. Similar situation occurs in operating systems when there are two or more processes hold some resources and wait for resources held by other(s). For example, in the below diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1.
  • 4. Deadlock can arise if following four Coffman Conditions A deadlock occurs if the four Coffman conditions hold true. But these conditions are not mutually exclusive. The Coffman conditions are given as follows • Mutual Exclusion • Hold and Wait • No Preemption • Circular Wait
  • 5. Mutual Exclusion There should be a resource that can only be held by one process at a time. In the diagram below, there is a single instance of Resource 1 and it is held by Process 1 only. The resources involved are non-shareable Explanation: At least one resource (thread) must be held in a non-shareable mode. that is, only one process at a time claims exclusive control of the resource. If another process requests that resource, the requesting process must be delayed until the resource has been released.
  • 6. Hold and Wait A process can hold multiple resources and still request more resources from other processes which are holding them. In the diagram given below, Process 2 holds Resource 2 and Resource 3 and is requesting the Resource 1 which is held by Process 1.
  • 7. No Preemption A resource cannot be preempted from a process by force. A process can only release a resource voluntarily. In the diagram below, Process 2 cannot preempt Resource 1 from Process 1. It will only be released when Process 1 give it up voluntarily after its execution is complete.
  • 8. Circular Wait A process is waiting for the resource held by the second process, which is waiting for the resource held by the third process and so on, till the last process is waiting for a resource held by the first process. This forms a circular chain. For example: Process 1 is allocated Resource2 and it is requesting Resource 1. Similarly, Process 2 is allocated Resource 1 and it is requesting Resource 2. This forms a circular wait loop.
  • 9. As an example, consider the traffic deadlock in the following figure
  • 10. Consider each section of the street as a resource. • Mutual exclusion condition applies, since only one vehicle can be on a section of the street at a time. • Hold-and-wait condition applies, since each vehicle is occupying a section of the street, and waiting to move on to the next section of the street. • No-preemptive condition applies, since a section of the street that is a section of the street that is occupied by a vehicle cannot be taken away from it. • Circular wait condition applies, since each vehicle is waiting on the next vehicle to move. That is, each vehicle in the traffic is waiting for a section of street held by the next vehicle in the traffic.