SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Chapter 8:  Deadlocks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Deadlock Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bridge Crossing Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
System Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deadlock Characterization ,[object Object],[object Object],[object Object],[object Object],[object Object],Deadlock can arise if four conditions hold simultaneously.
Resource-Allocation Graph ,[object Object],[object Object],[object Object],[object Object],[object Object],A set of vertices  V  and a set of edges  E .
Resource-Allocation Graph (Cont.) ,[object Object],[object Object],[object Object],[object Object],P i P i R j R j
Example of a Resource Allocation Graph
Resource Allocation Graph With A Deadlock
Resource Allocation Graph With A Cycle But No Deadlock
Basic Facts ,[object Object],[object Object],[object Object],[object Object]
Methods for Handling Deadlocks ,[object Object],[object Object],[object Object]
Deadlock Prevention ,[object Object],[object Object],[object Object],[object Object],Restrain the ways request can be made.
Deadlock Prevention (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Deadlock Avoidance ,[object Object],[object Object],[object Object],Requires that the system has some additional  a priori  information  available.
Safe State ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Basic Facts ,[object Object],[object Object],[object Object]
Safe, Unsafe , Deadlock State
Resource-Allocation Graph Algorithm ,[object Object],[object Object],[object Object],[object Object]
Resource-Allocation Graph For Deadlock Avoidance
Unsafe State In Resource-Allocation Graph
Banker’s Algorithm ,[object Object],[object Object],[object Object],[object Object]
Data Structures for the Banker’s Algorithm  ,[object Object],[object Object],[object Object],[object Object],[object Object],Let  n  = number of processes, and  m  = number of resources types.
Safety Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resource-Request Algorithm for Process  P i ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example of Banker’s Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example  P 1  Request (1,0,2) (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Deadlock Detection ,[object Object],[object Object],[object Object]
Single Instance of Each Resource Type ,[object Object],[object Object],[object Object],[object Object],[object Object]
Resource-Allocation Graph and Wait-for Graph Resource-Allocation Graph Corresponding wait-for graph
Several Instances of a Resource Type ,[object Object],[object Object],[object Object]
Detection Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Detection Algorithm (Cont.) ,[object Object],[object Object],Algorithm requires an order of O( m  x  n 2)  operations to detect whether the system is in deadlocked state.
Example of Detection Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Detection-Algorithm Usage ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recovery from Deadlock:  Process Termination ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recovery from Deadlock: Resource Preemption ,[object Object],[object Object],[object Object]
Combined Approach to Deadlock Handling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Traffic Deadlock for Exercise 8.4

Weitere ähnliche Inhalte

Was ist angesagt?

Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Shayek Parvez
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlock
wahab13
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
wahab13
 

Was ist angesagt? (20)

Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
 
OS_Ch8
OS_Ch8OS_Ch8
OS_Ch8
 
Bankers
BankersBankers
Bankers
 
O ssvv62015
O ssvv62015O ssvv62015
O ssvv62015
 
7 Deadlocks
7 Deadlocks7 Deadlocks
7 Deadlocks
 
Chapter 7 - Deadlocks
Chapter 7 - DeadlocksChapter 7 - Deadlocks
Chapter 7 - Deadlocks
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlock
 
Deadlock
DeadlockDeadlock
Deadlock
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Deadlock- System model, resource types, deadlock problem, deadlock characteri...Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Deadlock- System model, resource types, deadlock problem, deadlock characteri...
 
The implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserThe implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parser
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlock
DeadlockDeadlock
Deadlock
 
Os deadlock
Os deadlockOs deadlock
Os deadlock
 
Gp1242 007 oer ppt
Gp1242 007 oer pptGp1242 007 oer ppt
Gp1242 007 oer ppt
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
Deadlock
DeadlockDeadlock
Deadlock
 
Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
 

Andere mochten auch (11)

OSCh12
OSCh12OSCh12
OSCh12
 
Ch15
Ch15Ch15
Ch15
 
Ch11
Ch11Ch11
Ch11
 
Chapt05
Chapt05Chapt05
Chapt05
 
Chapt06
Chapt06Chapt06
Chapt06
 
OSCh19
OSCh19OSCh19
OSCh19
 
Rep
RepRep
Rep
 
Ch06
Ch06Ch06
Ch06
 
Chapt12
Chapt12Chapt12
Chapt12
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Ch8: Deadlocks
Ch8: DeadlocksCh8: Deadlocks
Ch8: Deadlocks
 

Ähnlich wie OSCh8

14th November - Deadlock Prevention, Avoidance.ppt
14th November - Deadlock Prevention, Avoidance.ppt14th November - Deadlock Prevention, Avoidance.ppt
14th November - Deadlock Prevention, Avoidance.ppt
Unknown664473
 
Module 3 Deadlocks.pptx
Module 3 Deadlocks.pptxModule 3 Deadlocks.pptx
Module 3 Deadlocks.pptx
shreesha16
 
Deadlock in Real Time operating Systempptx
Deadlock in Real Time operating SystempptxDeadlock in Real Time operating Systempptx
Deadlock in Real Time operating Systempptx
ssuserca5764
 

Ähnlich wie OSCh8 (20)

CH07.pdf
CH07.pdfCH07.pdf
CH07.pdf
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
Chapter 5(five).pdf
Chapter 5(five).pdfChapter 5(five).pdf
Chapter 5(five).pdf
 
Module-2Deadlock.ppt
Module-2Deadlock.pptModule-2Deadlock.ppt
Module-2Deadlock.ppt
 
14th November - Deadlock Prevention, Avoidance.ppt
14th November - Deadlock Prevention, Avoidance.ppt14th November - Deadlock Prevention, Avoidance.ppt
14th November - Deadlock Prevention, Avoidance.ppt
 
OSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptxOSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptx
 
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
 
Module 3 Deadlocks.pptx
Module 3 Deadlocks.pptxModule 3 Deadlocks.pptx
Module 3 Deadlocks.pptx
 
deadlock in OS.pptx
deadlock in OS.pptxdeadlock in OS.pptx
deadlock in OS.pptx
 
Deadlock (1).ppt
Deadlock (1).pptDeadlock (1).ppt
Deadlock (1).ppt
 
Os5
Os5Os5
Os5
 
deadlock part5 unit 2.ppt
deadlock part5 unit 2.pptdeadlock part5 unit 2.ppt
deadlock part5 unit 2.ppt
 
Os unit 4
Os unit 4Os unit 4
Os unit 4
 
Ch7 deadlocks
Ch7   deadlocksCh7   deadlocks
Ch7 deadlocks
 
Deadlock in Real Time operating Systempptx
Deadlock in Real Time operating SystempptxDeadlock in Real Time operating Systempptx
Deadlock in Real Time operating Systempptx
 
Sucet os module_3_notes
Sucet os module_3_notesSucet os module_3_notes
Sucet os module_3_notes
 
Deadlock avoidance and prevention .. computer networking
Deadlock avoidance and prevention .. computer networkingDeadlock avoidance and prevention .. computer networking
Deadlock avoidance and prevention .. computer networking
 
Bankers algorithm
Bankers algorithmBankers algorithm
Bankers algorithm
 
CSS430_Deadlock.pptx
CSS430_Deadlock.pptxCSS430_Deadlock.pptx
CSS430_Deadlock.pptx
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
 

Mehr von Joe Christensen

Live a life_that_matters
Live a life_that_mattersLive a life_that_matters
Live a life_that_matters
Joe Christensen
 

Mehr von Joe Christensen (20)

Live a life_that_matters
Live a life_that_mattersLive a life_that_matters
Live a life_that_matters
 
Advanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem SolutionsAdvanced Comuter Architecture Ch6 Problem Solutions
Advanced Comuter Architecture Ch6 Problem Solutions
 
Advanced Computer Architecture chapter 5 problem solutions
Advanced Computer  Architecture  chapter 5 problem solutionsAdvanced Computer  Architecture  chapter 5 problem solutions
Advanced Computer Architecture chapter 5 problem solutions
 
Advanced Computer Architecture Chapter 123 Problems Solution
Advanced Computer Architecture Chapter 123 Problems SolutionAdvanced Computer Architecture Chapter 123 Problems Solution
Advanced Computer Architecture Chapter 123 Problems Solution
 
Two Choices
Two ChoicesTwo Choices
Two Choices
 
IEEE 12207
IEEE 12207IEEE 12207
IEEE 12207
 
Lecture 13
Lecture 13Lecture 13
Lecture 13
 
Lecture 15
Lecture 15Lecture 15
Lecture 15
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
Lecture 11
Lecture 11Lecture 11
Lecture 11
 
Lecture 8 9
Lecture 8 9Lecture 8 9
Lecture 8 9
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Lecture 7n
Lecture 7nLecture 7n
Lecture 7n
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Lecture 14
Lecture 14Lecture 14
Lecture 14
 
Moble Communication
Moble CommunicationMoble Communication
Moble Communication
 
Ch20
Ch20Ch20
Ch20
 
Ch18
Ch18Ch18
Ch18
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

OSCh8