SlideShare a Scribd company logo
DEADLOCK
 The deadlocks problem
 System model
 Deadlock characterization
 Methods for handling deadlocks
 Deadlock prevention
 Deadlock avoidance
 Deadlock detection
 Recovery from deadlock
INTRODUCTION TO DEADLOCK
Every process needs some resources to complete its
execution. However, the resource is granted in a
sequential order.
 The process requests for some resource.
 OS grant the resource if it is available otherwise let the
process waits.
 The process uses it and release on the completion.
A Deadlock is a situation where each of the computer process
waits for a resource which is being assigned to some another
process.
In this situation, none of the process gets executed since the
resource it needs, is held by some other process which is also
waiting for some other resource to be released.
METHODS FOR HANDLING DEADLOCKS
Generally speaking, we can deal with the deadlock problem
in one of three ways:
• 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.
 The third solution is the one used by most operating systems,
including Linux and Windows. It is then up to the application
developer to write programs that handle deadlocks.
 Next, we elaborate briefly on each of the three methods for
handling deadlocks. Then, in Sections .we present detailed
algorithms.
 Before proceeding, we should mention that some researchers
have argued that none of the basic approaches alone is
appropriate for the entire spectrum of resource-allocation
problems in operating systems.
 The basic approaches can be combined, however, allowing us
to select an optimal approach for each class of resources in a
system.
 To ensure that deadlocks never occur, the system can use either
a deadlockprevention or a deadlock-avoidance scheme.
 Deadlock prevention provides a set of methods to ensure that
at least one of the necessary conditions (Section 7.2.1) cannot
hold.
 These methods prevent deadlocks by constraining how requests
for resources can be made. We discuss these methods in
Section.
DEADLOCK AVOIDANCE
 Deadlock avoidance requires that the operating system
be given additional information in advance concerning
which resources a process will request and use during its
lifetime.
 With this additional knowledge, the operating system
can decide for each request whether or not the process
should wait.
 To decide whether the current request can be satisfied or
must be delayed, the system must consider the resources
currently available, the resources currently allocated to
each process, and the future requests and releases of each
process. We discuss these schemes in Section.
 If a system does not employ either a deadlock-prevention or a
deadlockavoidance algorithm, then a deadlock situation may
arise.
 In this environment, the system can provide an algorithm that
examines the state of the system to determine whether a
deadlock has occurred and an algorithm to recover from the
deadlock (if a deadlock has indeed occurred). We discuss these
issues in Section
 In the absence of algorithms to detect and recover from
deadlocks, we may arrive at a situation in which the system is
in a deadlocked state yet has no way of recognizing what has
happened.
 In this case, the undetected deadlock will cause the system’s
performance to deteriorate, because resources are being held by
processes that cannot run and because more and more
processes, as they make requests for resources, will enter a
deadlocked state. Eventually, the system will stop functioning
and will need to be restarted manually.
 Although this method may not seem to be a viable approach to
the deadlock problem, it is nevertheless used in most operating
systems, as mentioned earlier.
 Expense is one important consideration.
 Ignoring the possibility of deadlocks is cheaper than the other
approaches. Since in many systems, deadlocks occur
infrequently (say, once per year), the extra expense of the be
put to use to recover from deadlock.
 In some circumstances, a system is in a frozen state but not in
a deadlocked state.
 other methods may not seem worthwhile.
 In addition, methods used to recover from other conditions
may
 We see this situation, for example, with a real-time process
running at the highest priority (or any process running on a
nonpreemptive scheduler) and never returning control to the
operating system.
 The system must have manual recovery methods for such
conditions and may simply use those techniques for deadlock
recovery.

More Related Content

Similar to operating system

OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
ZainabShahzad9
 
DEADLOCK PREVENTION AND AVOIDANCE.pptx
DEADLOCK PREVENTION AND AVOIDANCE.pptxDEADLOCK PREVENTION AND AVOIDANCE.pptx
DEADLOCK PREVENTION AND AVOIDANCE.pptx
PugalenthiSomasundar
 
Deadlock detection
Deadlock detectionDeadlock detection
Deadlock detection
Nadia Nahar
 
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjffOs presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
ZeelGoyani
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikSaeed Siddik
 
Deadlocks final
Deadlocks finalDeadlocks final
Deadlocks final
marangburu42
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
marangburu42
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
marangburu42
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
EktaVaswani2
 
Operating-System-Neil-Eder-Report-PPT-Final (1).pptx
Operating-System-Neil-Eder-Report-PPT-Final (1).pptxOperating-System-Neil-Eder-Report-PPT-Final (1).pptx
Operating-System-Neil-Eder-Report-PPT-Final (1).pptx
Juvil2
 
Deadlock
DeadlockDeadlock
Deadlock
Mahershi ACT
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
Shashank Yenurkar
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
DishaDwivedi2
 
Improved Deadlock Prevention Algorithms in Distributed Systems
Improved Deadlock Prevention Algorithms in Distributed SystemsImproved Deadlock Prevention Algorithms in Distributed Systems
Improved Deadlock Prevention Algorithms in Distributed Systems
IJEACS
 
Os case study word
Os case study wordOs case study word
Os case study word
Dhol Yash
 
Module3
Module3Module3
Module3
dilshad begum
 
osvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdfosvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdf
amadayshwan
 
Deadlock
DeadlockDeadlock
Deadlock
VISHAL DONGA
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docx
minaltmv
 

Similar to operating system (20)

OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
 
DEADLOCK PREVENTION AND AVOIDANCE.pptx
DEADLOCK PREVENTION AND AVOIDANCE.pptxDEADLOCK PREVENTION AND AVOIDANCE.pptx
DEADLOCK PREVENTION AND AVOIDANCE.pptx
 
Deadlock detection
Deadlock detectionDeadlock detection
Deadlock detection
 
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjffOs presentation final.pptxjjjjjdakajwsjjdhdfjff
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
 
Deadlocks final
Deadlocks finalDeadlocks final
Deadlocks final
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
 
Operating-System-Neil-Eder-Report-PPT-Final (1).pptx
Operating-System-Neil-Eder-Report-PPT-Final (1).pptxOperating-System-Neil-Eder-Report-PPT-Final (1).pptx
Operating-System-Neil-Eder-Report-PPT-Final (1).pptx
 
Deadlock
DeadlockDeadlock
Deadlock
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Improved Deadlock Prevention Algorithms in Distributed Systems
Improved Deadlock Prevention Algorithms in Distributed SystemsImproved Deadlock Prevention Algorithms in Distributed Systems
Improved Deadlock Prevention Algorithms in Distributed Systems
 
Os case study word
Os case study wordOs case study word
Os case study word
 
Module3
Module3Module3
Module3
 
osvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdfosvishal-160830131208 (1).pdf
osvishal-160830131208 (1).pdf
 
Deadlock
DeadlockDeadlock
Deadlock
 
Operating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docxOperating System- INTERPROCESS COMMUNICATION.docx
Operating System- INTERPROCESS COMMUNICATION.docx
 

More from renukarenuka9

mobile computing
mobile computingmobile computing
mobile computing
renukarenuka9
 
Dip
DipDip
Compiler design
Compiler designCompiler design
Compiler design
renukarenuka9
 
Web programming
Web programmingWeb programming
Web programming
renukarenuka9
 
Software engineering
Software engineeringSoftware engineering
Software engineering
renukarenuka9
 
Software engineering
Software engineeringSoftware engineering
Software engineering
renukarenuka9
 
Software engineering
Software engineeringSoftware engineering
Software engineering
renukarenuka9
 
Bigdata
BigdataBigdata
Bigdata
renukarenuka9
 
Bigdata ppt
Bigdata pptBigdata ppt
Bigdata ppt
renukarenuka9
 
Rdbms
RdbmsRdbms
Rdbms
RdbmsRdbms
operating system
operating systemoperating system
operating system
renukarenuka9
 
Rdbms
RdbmsRdbms
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
renukarenuka9
 
Computer network
Computer networkComputer network
Computer network
renukarenuka9
 
computer network
computer networkcomputer network
computer network
renukarenuka9
 
operating system
operating systemoperating system
operating system
renukarenuka9
 
data mining
data miningdata mining
data mining
renukarenuka9
 
COMPUTER NETWORK
COMPUTER NETWORKCOMPUTER NETWORK
COMPUTER NETWORK
renukarenuka9
 

More from renukarenuka9 (20)

mobile computing
mobile computingmobile computing
mobile computing
 
Dip
DipDip
Dip
 
Compiler design
Compiler designCompiler design
Compiler design
 
Web programming
Web programmingWeb programming
Web programming
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Software engineering
Software engineeringSoftware engineering
Software engineering
 
Bigdata
BigdataBigdata
Bigdata
 
Bigdata ppt
Bigdata pptBigdata ppt
Bigdata ppt
 
Rdbms
RdbmsRdbms
Rdbms
 
Rdbms
RdbmsRdbms
Rdbms
 
operating system
operating systemoperating system
operating system
 
Rdbms
RdbmsRdbms
Rdbms
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
Data mining
Data miningData mining
Data mining
 
Computer network
Computer networkComputer network
Computer network
 
computer network
computer networkcomputer network
computer network
 
operating system
operating systemoperating system
operating system
 
data mining
data miningdata mining
data mining
 
COMPUTER NETWORK
COMPUTER NETWORKCOMPUTER NETWORK
COMPUTER NETWORK
 

Recently uploaded

如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
Lokesh Patil
 
S.1 chemistry scheme term 2 for ordinary level
S.1 chemistry scheme term 2 for ordinary levelS.1 chemistry scheme term 2 for ordinary level
S.1 chemistry scheme term 2 for ordinary level
ronaldlakony0
 
role of pramana in research.pptx in science
role of pramana in research.pptx in sciencerole of pramana in research.pptx in science
role of pramana in research.pptx in science
sonaliswain16
 
in vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptxin vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptx
yusufzako14
 
nodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptxnodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptx
alishadewangan1
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Erdal Coalmaker
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
YOGESH DOGRA
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
SAMIR PANDA
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
silvermistyshot
 
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
yqqaatn0
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
kejapriya1
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
moosaasad1975
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
Richard Gill
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
muralinath2
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
ChetanK57
 
Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.
Nistarini College, Purulia (W.B) India
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Sérgio Sacani
 
extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
DiyaBiswas10
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
muralinath2
 

Recently uploaded (20)

如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Nutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technologyNutraceutical market, scope and growth: Herbal drug technology
Nutraceutical market, scope and growth: Herbal drug technology
 
S.1 chemistry scheme term 2 for ordinary level
S.1 chemistry scheme term 2 for ordinary levelS.1 chemistry scheme term 2 for ordinary level
S.1 chemistry scheme term 2 for ordinary level
 
role of pramana in research.pptx in science
role of pramana in research.pptx in sciencerole of pramana in research.pptx in science
role of pramana in research.pptx in science
 
in vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptxin vitro propagation of plants lecture note.pptx
in vitro propagation of plants lecture note.pptx
 
nodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptxnodule formation by alisha dewangan.pptx
nodule formation by alisha dewangan.pptx
 
Unveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdfUnveiling the Energy Potential of Marshmallow Deposits.pdf
Unveiling the Energy Potential of Marshmallow Deposits.pdf
 
Mammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also FunctionsMammalian Pineal Body Structure and Also Functions
Mammalian Pineal Body Structure and Also Functions
 
Seminar of U.V. Spectroscopy by SAMIR PANDA
 Seminar of U.V. Spectroscopy by SAMIR PANDA Seminar of U.V. Spectroscopy by SAMIR PANDA
Seminar of U.V. Spectroscopy by SAMIR PANDA
 
Lateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensiveLateral Ventricles.pdf very easy good diagrams comprehensive
Lateral Ventricles.pdf very easy good diagrams comprehensive
 
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
原版制作(carleton毕业证书)卡尔顿大学毕业证硕士文凭原版一模一样
 
bordetella pertussis.................................ppt
bordetella pertussis.................................pptbordetella pertussis.................................ppt
bordetella pertussis.................................ppt
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
 
Richard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlandsRichard's aventures in two entangled wonderlands
Richard's aventures in two entangled wonderlands
 
platelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptxplatelets_clotting_biogenesis.clot retractionpptx
platelets_clotting_biogenesis.clot retractionpptx
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.
 
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
Earliest Galaxies in the JADES Origins Field: Luminosity Function and Cosmic ...
 
extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 

operating system

  • 1.
  • 2. DEADLOCK  The deadlocks problem  System model  Deadlock characterization  Methods for handling deadlocks  Deadlock prevention  Deadlock avoidance  Deadlock detection  Recovery from deadlock
  • 3. INTRODUCTION TO DEADLOCK Every process needs some resources to complete its execution. However, the resource is granted in a sequential order.  The process requests for some resource.  OS grant the resource if it is available otherwise let the process waits.  The process uses it and release on the completion.
  • 4. A Deadlock is a situation where each of the computer process waits for a resource which is being assigned to some another process. In this situation, none of the process gets executed since the resource it needs, is held by some other process which is also waiting for some other resource to be released.
  • 5.
  • 6. METHODS FOR HANDLING DEADLOCKS Generally speaking, we can deal with the deadlock problem in one of three ways: • 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.
  • 7.  The third solution is the one used by most operating systems, including Linux and Windows. It is then up to the application developer to write programs that handle deadlocks.  Next, we elaborate briefly on each of the three methods for handling deadlocks. Then, in Sections .we present detailed algorithms.
  • 8.  Before proceeding, we should mention that some researchers have argued that none of the basic approaches alone is appropriate for the entire spectrum of resource-allocation problems in operating systems.  The basic approaches can be combined, however, allowing us to select an optimal approach for each class of resources in a system.
  • 9.  To ensure that deadlocks never occur, the system can use either a deadlockprevention or a deadlock-avoidance scheme.  Deadlock prevention provides a set of methods to ensure that at least one of the necessary conditions (Section 7.2.1) cannot hold.  These methods prevent deadlocks by constraining how requests for resources can be made. We discuss these methods in Section.
  • 10. DEADLOCK AVOIDANCE  Deadlock avoidance requires that the operating system be given additional information in advance concerning which resources a process will request and use during its lifetime.  With this additional knowledge, the operating system can decide for each request whether or not the process should wait.  To decide whether the current request can be satisfied or must be delayed, the system must consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process. We discuss these schemes in Section.
  • 11.  If a system does not employ either a deadlock-prevention or a deadlockavoidance algorithm, then a deadlock situation may arise.  In this environment, the system can provide an algorithm that examines the state of the system to determine whether a deadlock has occurred and an algorithm to recover from the deadlock (if a deadlock has indeed occurred). We discuss these issues in Section
  • 12.  In the absence of algorithms to detect and recover from deadlocks, we may arrive at a situation in which the system is in a deadlocked state yet has no way of recognizing what has happened.  In this case, the undetected deadlock will cause the system’s performance to deteriorate, because resources are being held by processes that cannot run and because more and more processes, as they make requests for resources, will enter a deadlocked state. Eventually, the system will stop functioning and will need to be restarted manually.
  • 13.  Although this method may not seem to be a viable approach to the deadlock problem, it is nevertheless used in most operating systems, as mentioned earlier.  Expense is one important consideration.  Ignoring the possibility of deadlocks is cheaper than the other approaches. Since in many systems, deadlocks occur infrequently (say, once per year), the extra expense of the be put to use to recover from deadlock.  In some circumstances, a system is in a frozen state but not in a deadlocked state.  other methods may not seem worthwhile.  In addition, methods used to recover from other conditions may
  • 14.  We see this situation, for example, with a real-time process running at the highest priority (or any process running on a nonpreemptive scheduler) and never returning control to the operating system.  The system must have manual recovery methods for such conditions and may simply use those techniques for deadlock recovery.