SlideShare a Scribd company logo
1 of 17
8/13/2017
1
Welcome
to
our presentation
on
Deadlock
Presented by:
Md. Sohag
Em@il : sohag.0315@gmail.com
Presented to:
Deadlock
2
8/13/2017
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
2 train approaches each other at crossing, both will come to full
stop and neither shall start until other has gone.
8/13/2017
3
Deadlock Example
 Traffic only in one direction.
 Each section of a bridge can be viewed as a resource.
 If a deadlock occurs, it can be resolved if one car backs up .
 Several cars may have to be backed up if a deadlock occurs. 8/13/2017
4
DEADLOCK CHARACTERIZATION
 Deadlock can arise if four conditions hold simultaneously.
 Mutual exclusion
 Hold and wait
 No preemption
 Circular wait
8/13/2017
5
RESOURCE-ALLOCATION GRAPH
 Deadlocks can be described in term of directed graph- SYSTEM RESOURCE-
ALLOCATION GRAPH.
 Process
 Resource Type with 4 instances
 Pi requests instance of Rj
 Pi is holding an instance of Rj
p
Pi
Rj
Pi
Rj
8/13/2017
6
EXAMPLE OF RESOURCE-ALLOCATION GRAPH
8/13/2017
7
p3
p1 p2
R2
R1 R3
R4
RESOURCE-ALLOCATIONGRAPH AND A DEADLOCK
8/13/2017
8
METHODS FOR HANDLINGDEADLOCK
 We can deal with DL problem in 3-ways:
 Prevention/Avoidance
 Detection/Correction
 Ignorance
8/13/2017
9
DEADLOCK PREVENTION
 Restrain the ways request can be made.
 Mutual Exclusion – not required for sharable resources;
must hold for non-sharable resources.
 Hold and Wait – must guarantee that whenever a process
requests a resource, it does not hold any other resources.
 No Preemption –
 Circular Wait –
8/13/2017
10
DEADLOCK AVOIDANCE
 Requires additional information about how resources are to
be used.
 The deadlock-avoidance algorithm dynamically examines
the resource-allocation state to ensure that there can never
be a circular-wait condition.
 Resource-allocation state is defined by the number of
available and allocated resources, and the maximum
demands of the processes.
8/13/2017
11
SAFE, UNSAFE DEADLOCK STATE
8/13/2017
12
SAFE & UNSAFE STATE - Example
8/13/2017
13
3
DEADLOCK AVOIDANCE ALGORITHM
 Single instance of a resource type.
Use a resource-allocation graph
Cycles are necessary are sufficient for deadlock
 Multiple instances of a resource type.
Use the banker’s algorithm
Cycles are necessary, but not sufficient for deadlock
8/13/2017
14
RESOURCE ALLOCATION GRAPHALGORITHM
 Claim edge Pi  Rj indicates that process Pj may request resource
Rj; represented by a dashed line.
 Claim edge converts to request edge when a process requests a
resource.
 Request edge converted to an assignment edge when the
resource is allocated to the process.
 When a resource is released by a process, assignment edge
reconverts to a claim edge.
 Resources must be claimed a priori in the system.
8/13/2017
15
BANKER’S ALGORITHM
 RAG is not applicable for multiple instance of resource
 Bankers’ algorithm - Multiple instances.
 Each process claims maximum resource needs a priori.
 When a process requests a resource it may have to wait.
 When a process gets all of its resources it must return them
in a finite amount of time.
8/13/2017
16
8/13/2017
17

More Related Content

Similar to Dead Lock

Lecture # 10-11 for deadlock operating system.ppt
Lecture # 10-11 for deadlock operating system.pptLecture # 10-11 for deadlock operating system.ppt
Lecture # 10-11 for deadlock operating system.ppt
RiaanSadiq
 
Galvin Operating Systems of deadlock.ppt
Galvin Operating Systems of deadlock.pptGalvin Operating Systems of deadlock.ppt
Galvin Operating Systems of deadlock.ppt
ranjithasr8
 
Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232
marangburu42
 

Similar to Dead Lock (20)

Chapter 8 Operating Systems silberschatz : deadlocks
Chapter 8 Operating Systems silberschatz : deadlocksChapter 8 Operating Systems silberschatz : deadlocks
Chapter 8 Operating Systems silberschatz : deadlocks
 
Deadlocks final
Deadlocks finalDeadlocks final
Deadlocks final
 
Deadlock in DBMS
Deadlock in DBMSDeadlock in DBMS
Deadlock in DBMS
 
Deadlock in DBMS
Deadlock in DBMSDeadlock in DBMS
Deadlock in DBMS
 
Deadlock in DBMS
Deadlock in DBMSDeadlock in DBMS
Deadlock in DBMS
 
Sucet os module_3_notes
Sucet os module_3_notesSucet os module_3_notes
Sucet os module_3_notes
 
Mca ii os u-3 dead lock & io systems
Mca  ii  os u-3 dead lock & io systemsMca  ii  os u-3 dead lock & io systems
Mca ii os u-3 dead lock & io systems
 
Lecture # 10-11 for deadlock operating system.ppt
Lecture # 10-11 for deadlock operating system.pptLecture # 10-11 for deadlock operating system.ppt
Lecture # 10-11 for deadlock operating system.ppt
 
Ch8: Deadlocks
Ch8: DeadlocksCh8: Deadlocks
Ch8: Deadlocks
 
ch7.ppt
ch7.pptch7.ppt
ch7.ppt
 
ch7.ppt
ch7.pptch7.ppt
ch7.ppt
 
MPMC chapter
MPMC chapterMPMC chapter
MPMC chapter
 
Galvin Operating Systems of deadlock.ppt
Galvin Operating Systems of deadlock.pptGalvin Operating Systems of deadlock.ppt
Galvin Operating Systems of deadlock.ppt
 
Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
 
Module3
Module3Module3
Module3
 
Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232
 
Dead Lock
Dead LockDead Lock
Dead Lock
 
Ch8
Ch8Ch8
Ch8
 

More from Sohag Babu (12)

Twisted pair cable
Twisted pair cableTwisted pair cable
Twisted pair cable
 
Software testing lifecycle
Software testing lifecycleSoftware testing lifecycle
Software testing lifecycle
 
Social networking
Social networkingSocial networking
Social networking
 
Simple web browser
Simple web browserSimple web browser
Simple web browser
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Presentation of transistor
Presentation of transistorPresentation of transistor
Presentation of transistor
 
Normalization & join
Normalization & joinNormalization & join
Normalization & join
 
E learning
E learningE learning
E learning
 
Applications of differential equations
Applications of differential equationsApplications of differential equations
Applications of differential equations
 
Application of numerical methods
Application of numerical methodsApplication of numerical methods
Application of numerical methods
 
Application layer
Application layerApplication layer
Application layer
 
4th generation computer
4th generation computer4th generation computer
4th generation computer
 

Recently uploaded

Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 

Dead Lock

  • 2. Presented by: Md. Sohag Em@il : sohag.0315@gmail.com Presented to: Deadlock 2 8/13/2017
  • 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 2 train approaches each other at crossing, both will come to full stop and neither shall start until other has gone. 8/13/2017 3
  • 4. Deadlock Example  Traffic only in one direction.  Each section of a bridge can be viewed as a resource.  If a deadlock occurs, it can be resolved if one car backs up .  Several cars may have to be backed up if a deadlock occurs. 8/13/2017 4
  • 5. DEADLOCK CHARACTERIZATION  Deadlock can arise if four conditions hold simultaneously.  Mutual exclusion  Hold and wait  No preemption  Circular wait 8/13/2017 5
  • 6. RESOURCE-ALLOCATION GRAPH  Deadlocks can be described in term of directed graph- SYSTEM RESOURCE- ALLOCATION GRAPH.  Process  Resource Type with 4 instances  Pi requests instance of Rj  Pi is holding an instance of Rj p Pi Rj Pi Rj 8/13/2017 6
  • 7. EXAMPLE OF RESOURCE-ALLOCATION GRAPH 8/13/2017 7 p3 p1 p2 R2 R1 R3 R4
  • 8. RESOURCE-ALLOCATIONGRAPH AND A DEADLOCK 8/13/2017 8
  • 9. METHODS FOR HANDLINGDEADLOCK  We can deal with DL problem in 3-ways:  Prevention/Avoidance  Detection/Correction  Ignorance 8/13/2017 9
  • 10. DEADLOCK PREVENTION  Restrain the ways request can be made.  Mutual Exclusion – not required for sharable resources; must hold for non-sharable resources.  Hold and Wait – must guarantee that whenever a process requests a resource, it does not hold any other resources.  No Preemption –  Circular Wait – 8/13/2017 10
  • 11. DEADLOCK AVOIDANCE  Requires additional information about how resources are to be used.  The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that there can never be a circular-wait condition.  Resource-allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes. 8/13/2017 11
  • 12. SAFE, UNSAFE DEADLOCK STATE 8/13/2017 12
  • 13. SAFE & UNSAFE STATE - Example 8/13/2017 13 3
  • 14. DEADLOCK AVOIDANCE ALGORITHM  Single instance of a resource type. Use a resource-allocation graph Cycles are necessary are sufficient for deadlock  Multiple instances of a resource type. Use the banker’s algorithm Cycles are necessary, but not sufficient for deadlock 8/13/2017 14
  • 15. RESOURCE ALLOCATION GRAPHALGORITHM  Claim edge Pi  Rj indicates that process Pj may request resource Rj; represented by a dashed line.  Claim edge converts to request edge when a process requests a resource.  Request edge converted to an assignment edge when the resource is allocated to the process.  When a resource is released by a process, assignment edge reconverts to a claim edge.  Resources must be claimed a priori in the system. 8/13/2017 15
  • 16. BANKER’S ALGORITHM  RAG is not applicable for multiple instance of resource  Bankers’ algorithm - Multiple instances.  Each process claims maximum resource needs a priori.  When a process requests a resource it may have to wait.  When a process gets all of its resources it must return them in a finite amount of time. 8/13/2017 16