SlideShare a Scribd company logo
1 of 27
 ᗩᔕEEᒪ Kᕼᗩᑎ
 𝕽𝖆𝖏𝖆 𝕴𝖘𝖗𝖆𝖗
 Nσυɱαɳ Gσԋαɾ
 ʂԋυʝαƚ Ⴆɠʅ
★·.·´¯`·.·★ ʀᴏʏᴀʟ sᴛᴀʀs ★·.·´¯`·.·★
Dead lock
,
contents
• What is dead lock?
• What is causes and effect of dead lock?
• Conditions of dead lock
• Dead lock handling strategies
What is dead lock?
• A deadlock is a situation in which two
computer programs sharing the same
resource are effectively preventing
each other from accessing the
resource, resulting in both programs
ceasing to function.
Daily life example
O.S example
Causes of dead lock
 Need of same resource by more than one process.
 Less resources more processes .
Effect of prevention of Deadlock
1.Low device utilization.
2.Reduce system throughout.
Conditions for dead lock
1.Mutual exclusion
2.Hold and wait
3.No-preemption
4.Circular wait
Mutual exclusion
 only one process at a time can
use a resource.
Hold and wait
 P1 hold one resource and wait for 2nd.
 P2 hold 2nd resource and wait for 1st.
No - Preemption
A resource can be released only
voluntarily by the process
holding it, after that process
has completed its task.
Circular wait
There exists a set {P0, P1, …, P0} of waiting
processes such that P0 is waiting for a resource
that is held by P1, P1 is waiting for a resource
that is held by P2, …, Pn–1 is waiting for a
resource that is held by Pn, and P0 is waiting for
a resource that is held by P0.
A set of vertices V and a set of edges E.
■ V is partitioned into two types:
● P = {P1, P2, …, Pn}, the set consisting of all the
processes in the system.
● R = {R1, R2, …, Rm}, the set consisting of all
resource types in the system.
Resource Allocation Graph
■ request edge – directed edge P1 → Rj.
■ assignment edge – directed edge Rj → Pi.
No-Deadlock
Deadlock
Methods for Handling Deadlocks
■ Ensure that the system will never enter a deadlock
state.
■ Allow the system to enter a deadlock state and
then recover.
■ Ignore the problem and pretend that deadlocks
never occur in the system; used by most operating
systems, including UNIX.
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.
● Require process to request and be allocated all its
resources before it begins execution, or allow process to request
resources only when the process has none.
● Low resource utilization; starvation possible.
Recovery from Deadlock:
■ Abort all deadlocked processes.
■ Abort one process at a time until the deadlock cycle is
eliminated.
■ In which order should we choose to abort?
● Priority of the process.
● How long process has computed, and how much longer to
completion.
● Resources the process has used.
● Resources process needs to complete.
● How many processes will need to be terminated.
● Is process interactive or batch?
Deadlock Avoidance
Requires that the system has some additional a priori
information available.
■ Simplest and most useful model requires that each process
declare the maximum number of resources of each type that it
may need.
■ 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.
Deadlock Detection and
Resolution:
It analyses the resource state to check that
deadlock exist or not. If so abort some process
And allocates the resources to other processes.
Deadlock in Operating System

More Related Content

What's hot

Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemSara Ali
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OSMsAnita2
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsSachin Chauhan
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded SystemsHimanshu Ghetia
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.MOHIT DADU
 
Concurrency: Mutual Exclusion and Synchronization
Concurrency: Mutual Exclusion and SynchronizationConcurrency: Mutual Exclusion and Synchronization
Concurrency: Mutual Exclusion and SynchronizationAnas Ebrahim
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 

What's hot (20)

Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlock Presentation
Deadlock PresentationDeadlock Presentation
Deadlock Presentation
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
Deadlock
DeadlockDeadlock
Deadlock
 
Mutual exclusion and sync
Mutual exclusion and syncMutual exclusion and sync
Mutual exclusion and sync
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Deadlock Avoidance - OS
Deadlock Avoidance - OSDeadlock Avoidance - OS
Deadlock Avoidance - OS
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
7 Deadlocks
7 Deadlocks7 Deadlocks
7 Deadlocks
 
Concurrency: Mutual Exclusion and Synchronization
Concurrency: Mutual Exclusion and SynchronizationConcurrency: Mutual Exclusion and Synchronization
Concurrency: Mutual Exclusion and Synchronization
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 

Similar to Deadlock in Operating System

Similar to Deadlock in Operating System (20)

Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
 
Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
6. Deadlock_1640227623705.pptx
6. Deadlock_1640227623705.pptx6. Deadlock_1640227623705.pptx
6. Deadlock_1640227623705.pptx
 
Module 3 Deadlocks.pptx
Module 3 Deadlocks.pptxModule 3 Deadlocks.pptx
Module 3 Deadlocks.pptx
 
Deadlocks Part- I.pdf
Deadlocks Part- I.pdfDeadlocks Part- I.pdf
Deadlocks Part- I.pdf
 
OS Module-3 (2).pptx
OS Module-3 (2).pptxOS Module-3 (2).pptx
OS Module-3 (2).pptx
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
 
osvzjsjjdndnnssnnsnsndndndnndeadlock.pptx
osvzjsjjdndnnssnnsnsndndndnndeadlock.pptxosvzjsjjdndnnssnnsnsndndndnndeadlock.pptx
osvzjsjjdndnnssnnsnsndndndnndeadlock.pptx
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
 
deadlocks.pptx
deadlocks.pptxdeadlocks.pptx
deadlocks.pptx
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock
DeadlockDeadlock
Deadlock
 
OS Presentation 1 (1).pptx
OS Presentation 1 (1).pptxOS Presentation 1 (1).pptx
OS Presentation 1 (1).pptx
 
Chapter5_Deadlock.pptx
Chapter5_Deadlock.pptxChapter5_Deadlock.pptx
Chapter5_Deadlock.pptx
 
chapter06-new.pptx
chapter06-new.pptxchapter06-new.pptx
chapter06-new.pptx
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlock
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
24 to 25 deadlockprevention
24 to 25 deadlockprevention24 to 25 deadlockprevention
24 to 25 deadlockprevention
 

Recently uploaded

UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
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
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
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
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
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)

UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
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
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
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
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
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
 

Deadlock in Operating System

  • 1.
  • 2.  ᗩᔕEEᒪ Kᕼᗩᑎ  𝕽𝖆𝖏𝖆 𝕴𝖘𝖗𝖆𝖗  Nσυɱαɳ Gσԋαɾ  ʂԋυʝαƚ Ⴆɠʅ ★·.·´¯`·.·★ ʀᴏʏᴀʟ sᴛᴀʀs ★·.·´¯`·.·★
  • 4. contents • What is dead lock? • What is causes and effect of dead lock? • Conditions of dead lock • Dead lock handling strategies
  • 5. What is dead lock? • A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function.
  • 8. Causes of dead lock  Need of same resource by more than one process.  Less resources more processes .
  • 9. Effect of prevention of Deadlock 1.Low device utilization. 2.Reduce system throughout.
  • 10. Conditions for dead lock 1.Mutual exclusion 2.Hold and wait 3.No-preemption 4.Circular wait
  • 11. Mutual exclusion  only one process at a time can use a resource.
  • 12. Hold and wait  P1 hold one resource and wait for 2nd.  P2 hold 2nd resource and wait for 1st.
  • 13. No - Preemption A resource can be released only voluntarily by the process holding it, after that process has completed its task.
  • 14. Circular wait There exists a set {P0, P1, …, P0} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn–1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0.
  • 15. A set of vertices V and a set of edges E. ■ V is partitioned into two types: ● P = {P1, P2, …, Pn}, the set consisting of all the processes in the system. ● R = {R1, R2, …, Rm}, the set consisting of all resource types in the system. Resource Allocation Graph
  • 16. ■ request edge – directed edge P1 → Rj. ■ assignment edge – directed edge Rj → Pi.
  • 19. Methods for Handling Deadlocks ■ Ensure that the system will never enter a deadlock state. ■ Allow the system to enter a deadlock state and then recover. ■ Ignore the problem and pretend that deadlocks never occur in the system; used by most operating systems, including UNIX.
  • 20. Deadlock Prevention Restrain the ways request can be made: ■ Mutual Exclusion – not required for sharable resources; must hold for non-sharable resources.
  • 21. ■ Hold and Wait – must guarantee that whenever a process requests a resource, it does not hold any other resources. ● Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none. ● Low resource utilization; starvation possible.
  • 22. Recovery from Deadlock: ■ Abort all deadlocked processes. ■ Abort one process at a time until the deadlock cycle is eliminated.
  • 23. ■ In which order should we choose to abort? ● Priority of the process. ● How long process has computed, and how much longer to completion. ● Resources the process has used. ● Resources process needs to complete. ● How many processes will need to be terminated. ● Is process interactive or batch?
  • 24. Deadlock Avoidance Requires that the system has some additional a priori information available. ■ Simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need.
  • 25. ■ 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.
  • 26. Deadlock Detection and Resolution: It analyses the resource state to check that deadlock exist or not. If so abort some process And allocates the resources to other processes.