SlideShare a Scribd company logo
1 of 14
“Deadlocks” in OS
Presented By : ZAHID ALI
Ciit/FA15-BCE-021/Atk
What are Deadlocks ?
• A set of blocked processes each holding a resource and
waiting to acquire a resource held by another process
in the set .
• In simple words, Deadlock occurs when a process
request the resources , the resources are not available at
that time so the process enter into waiting state . The
requesting resources are held by another waiting process
, both are in waiting state, this situation is called
Deadlock.
System Model
Request.
The process requests the resource.
Use.
The process can operate on the resource.
Release.
The process releases the resource.
Examples :
 System has two disk drives .
P1 and P2 each hold one disk drive and each
needs another one.
 Two trains approaches each other at crossing,
both will come to full stop each other and neither
shall start until other has gone.
Conditions for Deadlock :
Mutual Exclusion :
Processes claim the exclusive control of the resources they
require .
Hold and Wait :
Processes hold resources already allocated to them while
waiting for additional resources.
No preemption :
Resources cannot be removed from the process holding
them until the resources are used to completion.
Circular Wait :
A circular chain of processes exists such that each process
hold one or more resources that are being requested by
next process in the chain.
Traffic Example :
• Traffic only in one direction.
• Each section of the bridge can be viewed as a resource.
• Deadlock is occurred and it can be resolves if one car
backs up ( preempt resources and rollback).
Resource Allocation
Graphs
• 1) Resource Allocation with no deadlock
• 2) Resource Allocation with deadlocked.
Methods of Handling
Deadlocks
• We can use a protocol to prevent or avoid deadlocks,
ensuring that the system will never enter a deadlocked state.
• We can allow the system to enter a deadlocked state, detect
it, and recover.
• We can ignore the problem altogether and pretend that
deadlocks never occur in the system.
Deadlock Prevention
Prevention Eliminates one of the Four
Conditions
• Elimination of Mutual Exclusion
• Elimination of Hold&Wait condition
• Elimination of No preemption condition
• Elimination of Circular Wait Condition
Deadlock Avoidance
Dead lock avoidance technique is used
to avoid deadlock.
 Safe State: if deadlock not occur then it is safe state.
 Unsafe State: if deadlock occur then it is unsafe
state. The idea of avoiding deadlock is simply not allow
the system to enter an unsafe state.
Resource Allocation Graph
• Safe State:
• Unsafe State:
Banker’s Algorithm
Multiple instances
Each process must have a priority claim for
maximum use.
When a process requests a resource it may have
to wait.
When a process gets all its resources it must
return them in a finite amount of time.
Recovery from Deadlocks
• Process Termination
Abort all the process until the deadlock cycle is
eliminated.
• Resource Preemption
Preempt resources by selecting a victim and roll
it back by using starvation.
THANKS..!!
oAny Queries ?

More Related Content

What's hot

Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
 
Presentation on flynn’s classification
Presentation on flynn’s classificationPresentation on flynn’s classification
Presentation on flynn’s classificationvani gupta
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OSMsAnita2
 
Operating system 37 demand paging
Operating system 37 demand pagingOperating system 37 demand paging
Operating system 37 demand pagingVaibhav Khanna
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance SHIKHA GAUTAM
 
Exception | How Exceptions are Handled in MIPS architecture
Exception | How Exceptions are Handled in MIPS architectureException | How Exceptions are Handled in MIPS architecture
Exception | How Exceptions are Handled in MIPS architecturebabuece
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented CommunicationDilum Bandara
 
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
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corbaMayuresh Wadekar
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cacheVISHAL DONGA
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptinfomerlin
 
clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System Harshita Ved
 
resource management
  resource management  resource management
resource managementAshish Kumar
 

What's hot (20)

Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock Slides
Deadlock SlidesDeadlock Slides
Deadlock Slides
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
 
Presentation on flynn’s classification
Presentation on flynn’s classificationPresentation on flynn’s classification
Presentation on flynn’s classification
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Operating system 37 demand paging
Operating system 37 demand pagingOperating system 37 demand paging
Operating system 37 demand paging
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
 
Parallel computing persentation
Parallel computing persentationParallel computing persentation
Parallel computing persentation
 
Exception | How Exceptions are Handled in MIPS architecture
Exception | How Exceptions are Handled in MIPS architectureException | How Exceptions are Handled in MIPS architecture
Exception | How Exceptions are Handled in MIPS architecture
 
Message and Stream Oriented Communication
Message and Stream Oriented CommunicationMessage and Stream Oriented Communication
Message and Stream Oriented Communication
 
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
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
 
Cache memory and cache
Cache memory and cacheCache memory and cache
Cache memory and cache
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
 
clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
resource management
  resource management  resource management
resource management
 

Similar to Deadlocks

Similar to Deadlocks (20)

Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)Unit 3 part 2(DEADLOCK)
Unit 3 part 2(DEADLOCK)
 
Deadlocks by wani zahoor
Deadlocks by wani zahoorDeadlocks by wani zahoor
Deadlocks by wani zahoor
 
osvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdfosvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdf
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Deadlock in operating systems
Deadlock in operating systemsDeadlock in operating systems
Deadlock in operating systems
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
 
Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
 
3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx
 
Os case study word
Os case study wordOs case study word
Os case study word
 
Deadlock
DeadlockDeadlock
Deadlock
 
Operating system Deadlock
Operating system DeadlockOperating system Deadlock
Operating system Deadlock
 
Unit iv: Deadlocks
Unit iv: DeadlocksUnit iv: Deadlocks
Unit iv: Deadlocks
 
Deadlockproj.pptx
Deadlockproj.pptxDeadlockproj.pptx
Deadlockproj.pptx
 
Deadlockpresentation.pptx
Deadlockpresentation.pptxDeadlockpresentation.pptx
Deadlockpresentation.pptx
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
 
Deadlock's
Deadlock'sDeadlock's
Deadlock's
 
Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
 

More from Zahid Ali

Bit coin cryptocurrency
Bit coin cryptocurrencyBit coin cryptocurrency
Bit coin cryptocurrencyZahid Ali
 
Echelon and reduced echelon form & Filters
Echelon and reduced echelon form & FiltersEchelon and reduced echelon form & Filters
Echelon and reduced echelon form & FiltersZahid Ali
 
Importance of English Language
Importance of English LanguageImportance of English Language
Importance of English LanguageZahid Ali
 
Learning refines and elevates the mind
Learning refines and elevates the mindLearning refines and elevates the mind
Learning refines and elevates the mindZahid Ali
 
Role of media presentation
Role of media presentationRole of media presentation
Role of media presentationZahid Ali
 
History of kpk
History of kpkHistory of kpk
History of kpkZahid Ali
 
Inflation or rising prices
Inflation or rising pricesInflation or rising prices
Inflation or rising pricesZahid Ali
 
Purpose of life
Purpose of  lifePurpose of  life
Purpose of lifeZahid Ali
 
Black hawk down
Black hawk downBlack hawk down
Black hawk downZahid Ali
 
Learning refines and elevates the mind
Learning refines and elevates the mindLearning refines and elevates the mind
Learning refines and elevates the mindZahid Ali
 

More from Zahid Ali (14)

Bit coin cryptocurrency
Bit coin cryptocurrencyBit coin cryptocurrency
Bit coin cryptocurrency
 
Echelon and reduced echelon form & Filters
Echelon and reduced echelon form & FiltersEchelon and reduced echelon form & Filters
Echelon and reduced echelon form & Filters
 
Importance of English Language
Importance of English LanguageImportance of English Language
Importance of English Language
 
Learning refines and elevates the mind
Learning refines and elevates the mindLearning refines and elevates the mind
Learning refines and elevates the mind
 
Role of media presentation
Role of media presentationRole of media presentation
Role of media presentation
 
History of kpk
History of kpkHistory of kpk
History of kpk
 
Inflation or rising prices
Inflation or rising pricesInflation or rising prices
Inflation or rising prices
 
Purpose of life
Purpose of  lifePurpose of  life
Purpose of life
 
Begging
BeggingBegging
Begging
 
Hacking
HackingHacking
Hacking
 
Failure
FailureFailure
Failure
 
Democracy
DemocracyDemocracy
Democracy
 
Black hawk down
Black hawk downBlack hawk down
Black hawk down
 
Learning refines and elevates the mind
Learning refines and elevates the mindLearning refines and elevates the mind
Learning refines and elevates the mind
 

Recently uploaded

main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 

Recently uploaded (20)

main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 

Deadlocks

  • 1. “Deadlocks” in OS Presented By : ZAHID ALI Ciit/FA15-BCE-021/Atk
  • 2. What are Deadlocks ? • A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set . • In simple words, Deadlock occurs when a process request the resources , the resources are not available at that time so the process enter into waiting state . The requesting resources are held by another waiting process , both are in waiting state, this situation is called Deadlock.
  • 3. System Model Request. The process requests the resource. Use. The process can operate on the resource. Release. The process releases the resource.
  • 4. Examples :  System has two disk drives . P1 and P2 each hold one disk drive and each needs another one.  Two trains approaches each other at crossing, both will come to full stop each other and neither shall start until other has gone.
  • 5. Conditions for Deadlock : Mutual Exclusion : Processes claim the exclusive control of the resources they require . Hold and Wait : Processes hold resources already allocated to them while waiting for additional resources. No preemption : Resources cannot be removed from the process holding them until the resources are used to completion. Circular Wait : A circular chain of processes exists such that each process hold one or more resources that are being requested by next process in the chain.
  • 6. Traffic Example : • Traffic only in one direction. • Each section of the bridge can be viewed as a resource. • Deadlock is occurred and it can be resolves if one car backs up ( preempt resources and rollback).
  • 7. Resource Allocation Graphs • 1) Resource Allocation with no deadlock • 2) Resource Allocation with deadlocked.
  • 8. Methods of Handling Deadlocks • We can use a protocol to prevent or avoid deadlocks, ensuring that the system will never enter a deadlocked state. • We can allow the system to enter a deadlocked state, detect it, and recover. • We can ignore the problem altogether and pretend that deadlocks never occur in the system.
  • 9. Deadlock Prevention Prevention Eliminates one of the Four Conditions • Elimination of Mutual Exclusion • Elimination of Hold&Wait condition • Elimination of No preemption condition • Elimination of Circular Wait Condition
  • 10. Deadlock Avoidance Dead lock avoidance technique is used to avoid deadlock.  Safe State: if deadlock not occur then it is safe state.  Unsafe State: if deadlock occur then it is unsafe state. The idea of avoiding deadlock is simply not allow the system to enter an unsafe state.
  • 11. Resource Allocation Graph • Safe State: • Unsafe State:
  • 12. Banker’s Algorithm Multiple instances Each process must have a priority claim for maximum use. When a process requests a resource it may have to wait. When a process gets all its resources it must return them in a finite amount of time.
  • 13. Recovery from Deadlocks • Process Termination Abort all the process until the deadlock cycle is eliminated. • Resource Preemption Preempt resources by selecting a victim and roll it back by using starvation.