SlideShare uma empresa Scribd logo
1 de 38
Chapter 8:  Deadlocks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
The Deadlock Problem ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
System Model ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Deadlock Characterization ,[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts Deadlock can arise if four conditions hold simultaneously.
Resource-Allocation Graph ,[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts A set of vertices  V  and a set of edges  E .
Resource-Allocation Graph (Cont.) ,[object Object],[object Object],[object Object],[object Object],Operating System Concepts P i P i R j R j
Example of a Resource Allocation Graph Operating System Concepts
Resource Allocation Graph With A Deadlock Operating System Concepts
Resource Allocation Graph With A Cycle But No Deadlock Operating System Concepts
Basic Facts ,[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Methods for Handling Deadlocks ,[object Object],[object Object],[object Object],Operating System Concepts
Deadlock Prevention ,[object Object],[object Object],[object Object],[object Object],Operating System Concepts Restrain the ways request can be made.
Deadlock Prevention (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Deadlock Avoidance ,[object Object],[object Object],[object Object],Operating System Concepts 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],Operating System Concepts
Basic Facts ,[object Object],[object Object],[object Object],Operating System Concepts
Safe, Unsafe , Deadlock State  Operating System Concepts
Resource-Allocation Graph Algorithm ,[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Resource-Allocation Graph For Deadlock Avoidance Operating System Concepts
Unsafe State In Resource-Allocation Graph Operating System Concepts
Banker’s Algorithm ,[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Data Structures for the Banker’s Algorithm  ,[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts 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],Operating System Concepts
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],Operating System Concepts
Example of Banker’s Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Example (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
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],Operating System Concepts
Deadlock Detection ,[object Object],[object Object],[object Object],Operating System Concepts
Single Instance of Each Resource Type ,[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Resource-Allocation Graph and Wait-for Graph Operating System Concepts Resource-Allocation Graph Corresponding wait-for graph
Several Instances of a Resource Type ,[object Object],[object Object],[object Object],Operating System Concepts
Detection Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Detection Algorithm (Cont.) ,[object Object],[object Object],Operating System Concepts
Example of Detection Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Example (Cont.) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Detection-Algorithm Usage ,[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Recovery from Deadlock:  Process Termination ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Operating System Concepts
Recovery from Deadlock: Resource Preemption ,[object Object],[object Object],[object Object],Operating System Concepts

Mais conteúdo relacionado

Mais procurados

Loaders complete
Loaders completeLoaders complete
Loaders completeFaisal Shah
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionSHIKHA GAUTAM
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlockwahab13
 
Synchronization
SynchronizationSynchronization
SynchronizationSara shall
 
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
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlockstech2click
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Ra'Fat Al-Msie'deen
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handlingSuraj Kumar
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlocksangrampatil81
 
Administering security
Administering securityAdministering security
Administering securityG Prachi
 
Global state recording in Distributed Systems
Global state recording in Distributed SystemsGlobal state recording in Distributed Systems
Global state recording in Distributed SystemsArsnet
 

Mais procurados (20)

7 Deadlocks
7 Deadlocks7 Deadlocks
7 Deadlocks
 
Loaders complete
Loaders completeLoaders complete
Loaders complete
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock Detection
 
Deadlock
DeadlockDeadlock
Deadlock
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlock
 
Synchronization
SynchronizationSynchronization
Synchronization
 
OS - Deadlock
OS - DeadlockOS - Deadlock
OS - Deadlock
 
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)
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handling
 
Deadlock
DeadlockDeadlock
Deadlock
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Administering security
Administering securityAdministering security
Administering security
 
Global state recording in Distributed Systems
Global state recording in Distributed SystemsGlobal state recording in Distributed Systems
Global state recording in Distributed Systems
 

Destaque (20)

Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
Galvin-operating System(Ch8)
Galvin-operating System(Ch8)Galvin-operating System(Ch8)
Galvin-operating System(Ch8)
 
Lec11 semaphores
Lec11 semaphoresLec11 semaphores
Lec11 semaphores
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Ch7 OS
Ch7 OSCh7 OS
Ch7 OS
 
Deadlocks
 Deadlocks Deadlocks
Deadlocks
 
Ch8
Ch8Ch8
Ch8
 
Os5
Os5Os5
Os5
 
Mutual Exclusion using Peterson's Algorithm
Mutual Exclusion using Peterson's AlgorithmMutual Exclusion using Peterson's Algorithm
Mutual Exclusion using Peterson's Algorithm
 
Deadlock
DeadlockDeadlock
Deadlock
 
Java Threading
Java ThreadingJava Threading
Java Threading
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
 
thread-clustering
thread-clusteringthread-clustering
thread-clustering
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Dead Lock
Dead LockDead Lock
Dead Lock
 
Ch05
Ch05Ch05
Ch05
 
Lecture5
Lecture5Lecture5
Lecture5
 
Threading
ThreadingThreading
Threading
 

Semelhante a Ch8 OS

Semelhante a Ch8 OS (20)

Ice
IceIce
Ice
 
Module-2Deadlock.ppt
Module-2Deadlock.pptModule-2Deadlock.ppt
Module-2Deadlock.ppt
 
OS_Ch8
OS_Ch8OS_Ch8
OS_Ch8
 
OSCh8
OSCh8OSCh8
OSCh8
 
Operating System
Operating SystemOperating System
Operating System
 
CH07.pdf
CH07.pdfCH07.pdf
CH07.pdf
 
Chapter 5(five).pdf
Chapter 5(five).pdfChapter 5(five).pdf
Chapter 5(five).pdf
 
Deadlock in Real Time operating Systempptx
Deadlock in Real Time operating SystempptxDeadlock in Real Time operating Systempptx
Deadlock in Real Time operating Systempptx
 
OSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptxOSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptx
 
14th November - Deadlock Prevention, Avoidance.ppt
14th November - Deadlock Prevention, Avoidance.ppt14th November - Deadlock Prevention, Avoidance.ppt
14th November - Deadlock Prevention, Avoidance.ppt
 
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
 
Gp1242 007 oer ppt
Gp1242 007 oer pptGp1242 007 oer ppt
Gp1242 007 oer ppt
 
Module 3 Deadlocks.pptx
Module 3 Deadlocks.pptxModule 3 Deadlocks.pptx
Module 3 Deadlocks.pptx
 
Ch7 deadlocks
Ch7   deadlocksCh7   deadlocks
Ch7 deadlocks
 
deadlock in OS.pptx
deadlock in OS.pptxdeadlock in OS.pptx
deadlock in OS.pptx
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
 
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
 
Sucet os module_3_notes
Sucet os module_3_notesSucet os module_3_notes
Sucet os module_3_notes
 
Deadlock (1).ppt
Deadlock (1).pptDeadlock (1).ppt
Deadlock (1).ppt
 

Mais de C.U

Ch21 OS
Ch21 OSCh21 OS
Ch21 OSC.U
 
Ch18 OS
Ch18 OSCh18 OS
Ch18 OSC.U
 
Ch20 OS
Ch20 OSCh20 OS
Ch20 OSC.U
 
Ch19 OS
Ch19 OSCh19 OS
Ch19 OSC.U
 
Ch17 OS
Ch17 OSCh17 OS
Ch17 OSC.U
 
Ch13 OS
Ch13 OSCh13 OS
Ch13 OSC.U
 
Ch16 OS
Ch16 OSCh16 OS
Ch16 OSC.U
 
Ch15 OS
Ch15 OSCh15 OS
Ch15 OSC.U
 
Ch14 OS
Ch14 OSCh14 OS
Ch14 OSC.U
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OSC.U
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OSC.U
 
Ch10 OS
Ch10 OSCh10 OS
Ch10 OSC.U
 
Ch6
Ch6Ch6
Ch6C.U
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
Ch1 OS
Ch1 OSCh1 OS
Ch1 OSC.U
 
Ch2 OS
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