SlideShare une entreprise Scribd logo
1  sur  17
DEADLOCKS IN
OPERATING SYSTEM
OPERATING SYSTEM
Presented by :
Wajiha Siddiqui
Sara Ali
Aisha Hameed
1. The Deadlock Problem
2. Deadlock Characterization
3. Deadlock Modeling
4. Resource Allocation Graph
5. Methods for Handling Deadlocks
 Deadlock Prevention
 Deadlock Avoidance
 Deadlock Detection
 Recovery from Deadlock
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.
o Example
 Process-1 requests the printer, gets it
 Process-2 requests the tape unit, gets it Process-1 and
 Process-1 requests the tape unit, waits Process-2 are
 Process-2 requests the printer, waits deadlocked!
FOUR CONDITIONS FOR DEADLOCKS???
1. Mutual Exclusion Condition
2. Hold & Wait Condition
3. No Preemption Condition
4. Circular Wait Condition
DEADLOCK MODELING???
Modeled with directed graphs
HOW DEADLOCKS OCCUR?
HOW DEADLOCKS CAN BE AVOIDED???
RESOURCE ALLOCATION GRAPHS???
 CIRCLES
 represents processes
 SQUARE
 represents classes of identical resources
 SMALL SQUARES DRAWN INSIDE LARGE SQUARES
 Indicate separate identical resources of each class
 If the resource allocation graph contains no cycles then there is
no deadlock in the system at that instance.
 If there is a cycle
o If there is only one instance per resource type than there is a deadlock
o If there is more than once instance for some resource type than there may
or may not be a deadlock
EXAMPLE OF A RESOURCE ALLOCATION GRAPH
HOW TO HANDLE DEADLOCKS???
• Four major areas of interest in deadlock research
- Deadlock Prevention
- Deadlock Avoidance
- Deadlock Detection
- Deadlock Recovery
DEADLOCK PREVENTION???
• Prevention eliminates one of four conditions
1. Elimination Of Mutual Exclusion
2. Elimination Of Hold & Wait Condition
3. Elimination Of No Preemption Condition
4. Elimination Of Circular Wait Condition
DEADLOCK AVOIDANCE???
• Maximum requirements of
each resource must be stated
in advance by each process.
• Two Approaches
• Two Algorithms
o Resource Allocation Algorithms
o The Banker’s Algorithm
DEADLOCK DETECTION???
• Determines if deadlock has occurred
• Identifies those processes & resources
involved in the deadlock
• Algorithms can incur significant
runtime overhead
RECOVERY FROM DEADLOCKS???
• Process Termination
o Abort all deadlocked processes.
o Abort one process at a time until
the deadlock cycle is eliminated.
• Resource Preemption
o Selecting a victim
o Rollback
o Starvation
Deadlocks in operating system

Contenu connexe

Tendances

Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OSMsAnita2
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock GalvinSonali Chauhan
 
Deadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDeadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDHIVYADEVAKI
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbiansaad symbian
 
Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock DetectionStuart Joy
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating SystemAUST
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lockKaram Munir Butt
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handlingSuraj Kumar
 

Tendances (20)

Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock Galvin
 
Deadlock
DeadlockDeadlock
Deadlock
 
Dead Lock
Dead LockDead Lock
Dead Lock
 
Deadlock dbms
Deadlock dbmsDeadlock dbms
Deadlock dbms
 
Chapter 7 - Deadlocks
Chapter 7 - DeadlocksChapter 7 - Deadlocks
Chapter 7 - Deadlocks
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Deadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDeadlock Detection in Distributed Systems
Deadlock Detection in Distributed Systems
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
 
Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock Detection
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handling
 
deadlock
deadlockdeadlock
deadlock
 
Os Threads
Os ThreadsOs Threads
Os Threads
 

En vedette

Intro to Deadlocks
Intro to DeadlocksIntro to Deadlocks
Intro to Deadlockslionpeal
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemMidhun Sankar
 
Direct memory access
Direct memory accessDirect memory access
Direct memory accessshubham kuwar
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systemstotallooser
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating systemSalma Begum
 
Direct Memory Access(DMA)
Direct Memory Access(DMA)Direct Memory Access(DMA)
Direct Memory Access(DMA)Page Maker
 

En vedette (8)

Intro to Deadlocks
Intro to DeadlocksIntro to Deadlocks
Intro to Deadlocks
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlock
DeadlockDeadlock
Deadlock
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systems
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 
Direct Memory Access(DMA)
Direct Memory Access(DMA)Direct Memory Access(DMA)
Direct Memory Access(DMA)
 

Similaire à Deadlocks in operating system

Similaire à Deadlocks in operating system (20)

Deadlocks by wani zahoor
Deadlocks by wani zahoorDeadlocks by wani zahoor
Deadlocks by wani zahoor
 
Deadlock
DeadlockDeadlock
Deadlock
 
FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3
 
Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
 
OS-Part-06.pdf
OS-Part-06.pdfOS-Part-06.pdf
OS-Part-06.pdf
 
osvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdfosvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdf
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock Slides
Deadlock SlidesDeadlock Slides
Deadlock Slides
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
3 (2).ppt
3 (2).ppt3 (2).ppt
3 (2).ppt
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
 
chapter06-new.pptx
chapter06-new.pptxchapter06-new.pptx
chapter06-new.pptx
 
Deadlocks Part- I.pdf
Deadlocks Part- I.pdfDeadlocks Part- I.pdf
Deadlocks Part- I.pdf
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
ikh311-05
ikh311-05ikh311-05
ikh311-05
 
Os case study word
Os case study wordOs case study word
Os case study word
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Dernier (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

Deadlocks in operating system

  • 2. OPERATING SYSTEM Presented by : Wajiha Siddiqui Sara Ali Aisha Hameed
  • 3. 1. The Deadlock Problem 2. Deadlock Characterization 3. Deadlock Modeling 4. Resource Allocation Graph 5. Methods for Handling Deadlocks  Deadlock Prevention  Deadlock Avoidance  Deadlock Detection  Recovery from Deadlock
  • 4. 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. o Example  Process-1 requests the printer, gets it  Process-2 requests the tape unit, gets it Process-1 and  Process-1 requests the tape unit, waits Process-2 are  Process-2 requests the printer, waits deadlocked!
  • 5. FOUR CONDITIONS FOR DEADLOCKS??? 1. Mutual Exclusion Condition 2. Hold & Wait Condition 3. No Preemption Condition 4. Circular Wait Condition
  • 8. HOW DEADLOCKS CAN BE AVOIDED???
  • 9. RESOURCE ALLOCATION GRAPHS???  CIRCLES  represents processes  SQUARE  represents classes of identical resources  SMALL SQUARES DRAWN INSIDE LARGE SQUARES  Indicate separate identical resources of each class
  • 10.  If the resource allocation graph contains no cycles then there is no deadlock in the system at that instance.  If there is a cycle o If there is only one instance per resource type than there is a deadlock o If there is more than once instance for some resource type than there may or may not be a deadlock
  • 11. EXAMPLE OF A RESOURCE ALLOCATION GRAPH
  • 12. HOW TO HANDLE DEADLOCKS??? • Four major areas of interest in deadlock research - Deadlock Prevention - Deadlock Avoidance - Deadlock Detection - Deadlock Recovery
  • 13. DEADLOCK PREVENTION??? • Prevention eliminates one of four conditions 1. Elimination Of Mutual Exclusion 2. Elimination Of Hold & Wait Condition 3. Elimination Of No Preemption Condition 4. Elimination Of Circular Wait Condition
  • 14. DEADLOCK AVOIDANCE??? • Maximum requirements of each resource must be stated in advance by each process. • Two Approaches • Two Algorithms o Resource Allocation Algorithms o The Banker’s Algorithm
  • 15. DEADLOCK DETECTION??? • Determines if deadlock has occurred • Identifies those processes & resources involved in the deadlock • Algorithms can incur significant runtime overhead
  • 16. RECOVERY FROM DEADLOCKS??? • Process Termination o Abort all deadlocked processes. o Abort one process at a time until the deadlock cycle is eliminated. • Resource Preemption o Selecting a victim o Rollback o Starvation