SlideShare a Scribd company logo
S.V.I.T.,Vasad
 NAME: RAJAN SHAH  TOPIC: DEADLOCK:
DEFINITION,
CHARACTERISTICS &
PREVENTION.
DEADLOCK
 Definition: 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.
 The reason, why earliest computer OS ran only one program
at a time.
 A set of processes is deadlocked if each process in the set is
waiting for an event that only another process can trigger.
Continue...
 As all the processes in the set are waiting for an another
process to trigger an event that could wake up any of the
other members of the set, all the processes would wait for
ever.
 None of the processes can run, none of them can release any
resource, and thus none can be awakened.
 The no. of processes and the no. and kind of resources
processed and requested are unimp.. This kind of request
holds for any kind of resource and is called Resource
Deadlock.
Characteristics Of Deadlock
 A deadlock situation can arise if the following four conditions
hold simultaneously in a system:
1. Mutual Exclusion
2. Hold & Wait
3. No Pre-emption
4. Circular wait.
Prevention Techniques
 The methods to prevent the Deadlock are:
1. Attacking the Mutual Exclusion Condition.
2. Attacking the Hold & Wait Condition.
3. Attacking the No Pre-emption Condition.
4. Attacking the Circular Wait Condition.
Attacking the Mutual Exclusion
Condition
 Mutual Exclusion: For two processes, if any one process is
accessing the common resource then the another process is
excluded from accessing the resource.
 Thus, each resource is either currently allocated to exactly
one process or it is available for other process to access it.
Two processes can’t simultaneously access the common
resource.
Example
 It is clear that by allowing two processes to write on the printer
simultaneously will lead to chaos.
 Actually, the only process which requests the physical printer is
the printer daemon.
 Printer daemon never requests any other resource, so the
deadlock can be eliminated and also it prints only after the
complete o/p file is available.
 But this could in itself lead to deadlock for two processes having
finished their part, but not all, of their o/p, and can’t continue.
 Thus, avoiding to assign a resource unless not absolutely
necessary and try to make less processes request for the
resource.
Attacking the Hold & Wait
Condition
 Hold and Wait: In this scenario, processes currently holding
resource can request new resource to complete its task.
 If the process requests all the resources before starting the
execution, deadlocks can be eliminated.
 I.E. if everything is available, process will be allocated
whatever it needs and can run to completion.
 Whereas, if one or more of the requested resource is/are
busy, then nothing will be allocated and the process would
just wait for the resource to become free and enter the
critical region.
 The problem that how many resources does a process may
need can’t be known until it has started running.
Example
 Consider a process, that reads data from an i/p tape, analyzes
it for an hour, and then writes an o/p tape as well as plotting
the results.
 Thus, if all resources are requested in adv, the process will tie
up the o/p tape and the plotter for an hour.
 Thus, this method wastes the resources as for an hour no
other process would be able to use the plotter and the o/p
tape.
Attacking the No Pre-emption
Condition
 No Pre-emption: Once a process holds a resource, it can’t be
taken away by another process or the kernel and resource
can only be voluntarily released by the process.
 Example: if a process is assigned a printer and is in the middle
of printing its output, forcibly taking away the printer because
the plotter needed isn’t available is not possible.
 Thus, a resource can be used only if the process holding it,
releases it voluntarily.
Attacking the Circular Wait
Condition
 Circular wait: Each process is waiting to obtain a resource
which is held by another process.
 The circular wait can be eliminated by a rule that if a process
is holding a resource at the moment then it can’t request for
other resource, and if it wants to access the other resource
then it must release the first one.
 Another way to avoid the circular wait is to provide a global
numbering of all the resources.
 A process can request whenever it wants, but all the request
must be made in numerical order.
Example
 Consider the following resources numbered as below:
1. Image setter
2. Scanner
3. Plotter
4. Tape-Drive
5. CD-ROM drive.
A process may request first a printer and then a tape drive, but
it can’t request first a plotter and then a printer.
Example
 Here, if A requests for j ;
i>j, then A is not allowed to
request j because that is
lower than what it already
has.
 Similarly, if B requests for i;
i<j, then B is not allowed to
request for i.
 Thus, either way deadlock
is not possible.
A
i
B
j
THANK YOU

More Related Content

What's hot

Process in operating system
Process in operating systemProcess in operating system
Process in operating system
Chetan Mahawar
 
Deadlock
DeadlockDeadlock
Deadlock
Rajandeep Gill
 
Parallel processing
Parallel processingParallel processing
Parallel processing
Syed Zaid Irshad
 
Architecture of operating system
Architecture of operating systemArchitecture of operating system
Architecture of operating system
Supriya Kumari
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor scheduling
Vaibhav Khanna
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
Karam Munir Butt
 
BANKER'S ALGORITHM
BANKER'S ALGORITHMBANKER'S ALGORITHM
BANKER'S ALGORITHM
Muhammad Baqar Kazmi
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
myrajendra
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
Janki Shah
 
Mutual exclusion
Mutual exclusionMutual exclusion
Mutual exclusion
Dillip Behera
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
Sweetestangel Kochar
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
IkhtiarUddinShaHin
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 
process control block
process control blockprocess control block
process control block
Vikas SHRIVASTAVA
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
meet darji
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
ChethanMp7
 
Processes and threads
Processes and threadsProcesses and threads
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
prachi mewara
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
Deepika Balichwal
 
Bankers
BankersBankers

What's hot (20)

Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 
Deadlock
DeadlockDeadlock
Deadlock
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Architecture of operating system
Architecture of operating systemArchitecture of operating system
Architecture of operating system
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor scheduling
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
BANKER'S ALGORITHM
BANKER'S ALGORITHMBANKER'S ALGORITHM
BANKER'S ALGORITHM
 
Operating system services 9
Operating system services 9Operating system services 9
Operating system services 9
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Mutual exclusion
Mutual exclusionMutual exclusion
Mutual exclusion
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
process control block
process control blockprocess control block
process control block
 
Threads .ppt
Threads .pptThreads .ppt
Threads .ppt
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Bankers
BankersBankers
Bankers
 

Similar to Deadlock- Operating System

Deadlocks
DeadlocksDeadlocks
Operating system Deadlock
Operating system DeadlockOperating system Deadlock
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
DishaDwivedi2
 
Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
madhuributani
 
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
svulasal
 
Module3
Module3Module3
Module3
dilshad begum
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
Md. Mahedi Mahfuj
 
Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
Gichelle Amon
 
Os case study word
Os case study wordOs case study word
Os case study word
Dhol Yash
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
EktaVaswani2
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
ZainabShahzad9
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
tech2click
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
Shipra Swati
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
marangburu42
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
marangburu42
 
Deadlock and Banking Algorithm
Deadlock and Banking AlgorithmDeadlock and Banking Algorithm
Deadlock and Banking Algorithm
MD.ANISUR RAHMAN
 
Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Deadlock- System model, resource types, deadlock problem, deadlock characteri...Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Wakil Kumar
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
AUST
 
Deadlocks final
Deadlocks finalDeadlocks final
Deadlocks final
marangburu42
 
Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232
marangburu42
 

Similar to Deadlock- Operating System (20)

Deadlocks
DeadlocksDeadlocks
Deadlocks
 
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
 
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
 
Module3
Module3Module3
Module3
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
 
Os case study word
Os case study wordOs case study word
Os case study word
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
 
Deadlock and Banking Algorithm
Deadlock and Banking AlgorithmDeadlock and Banking Algorithm
Deadlock and Banking Algorithm
 
Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Deadlock- System model, resource types, deadlock problem, deadlock characteri...Deadlock- System model, resource types, deadlock problem, deadlock characteri...
Deadlock- System model, resource types, deadlock problem, deadlock characteri...
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Deadlocks final
Deadlocks finalDeadlocks final
Deadlocks final
 
Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232
 

More from Rajan Shah

Xml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web TechnologyXml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web Technology
Rajan Shah
 
Timing and control circuit
Timing and control circuitTiming and control circuit
Timing and control circuit
Rajan Shah
 
Rethrowing exception- JAVA
Rethrowing exception- JAVARethrowing exception- JAVA
Rethrowing exception- JAVA
Rajan Shah
 
Np Completeness
Np CompletenessNp Completeness
Np Completeness
Rajan Shah
 
Lex Tool
Lex ToolLex Tool
Lex Tool
Rajan Shah
 
Files and streams In Java
Files and streams In JavaFiles and streams In Java
Files and streams In Java
Rajan Shah
 
Data Reduction
Data ReductionData Reduction
Data Reduction
Rajan Shah
 
Cyclic Redundancy Check
Cyclic Redundancy CheckCyclic Redundancy Check
Cyclic Redundancy Check
Rajan Shah
 
Client server s/w Engineering
Client server s/w EngineeringClient server s/w Engineering
Client server s/w Engineering
Rajan Shah
 
Bluetooth protocol
Bluetooth protocolBluetooth protocol
Bluetooth protocol
Rajan Shah
 

More from Rajan Shah (10)

Xml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web TechnologyXml dtd- Document Type Definition- Web Technology
Xml dtd- Document Type Definition- Web Technology
 
Timing and control circuit
Timing and control circuitTiming and control circuit
Timing and control circuit
 
Rethrowing exception- JAVA
Rethrowing exception- JAVARethrowing exception- JAVA
Rethrowing exception- JAVA
 
Np Completeness
Np CompletenessNp Completeness
Np Completeness
 
Lex Tool
Lex ToolLex Tool
Lex Tool
 
Files and streams In Java
Files and streams In JavaFiles and streams In Java
Files and streams In Java
 
Data Reduction
Data ReductionData Reduction
Data Reduction
 
Cyclic Redundancy Check
Cyclic Redundancy CheckCyclic Redundancy Check
Cyclic Redundancy Check
 
Client server s/w Engineering
Client server s/w EngineeringClient server s/w Engineering
Client server s/w Engineering
 
Bluetooth protocol
Bluetooth protocolBluetooth protocol
Bluetooth protocol
 

Recently uploaded

Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 

Recently uploaded (20)

Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 

Deadlock- Operating System

  • 1. S.V.I.T.,Vasad  NAME: RAJAN SHAH  TOPIC: DEADLOCK: DEFINITION, CHARACTERISTICS & PREVENTION.
  • 2. DEADLOCK  Definition: 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.  The reason, why earliest computer OS ran only one program at a time.  A set of processes is deadlocked if each process in the set is waiting for an event that only another process can trigger.
  • 3. Continue...  As all the processes in the set are waiting for an another process to trigger an event that could wake up any of the other members of the set, all the processes would wait for ever.  None of the processes can run, none of them can release any resource, and thus none can be awakened.  The no. of processes and the no. and kind of resources processed and requested are unimp.. This kind of request holds for any kind of resource and is called Resource Deadlock.
  • 4. Characteristics Of Deadlock  A deadlock situation can arise if the following four conditions hold simultaneously in a system: 1. Mutual Exclusion 2. Hold & Wait 3. No Pre-emption 4. Circular wait.
  • 5. Prevention Techniques  The methods to prevent the Deadlock are: 1. Attacking the Mutual Exclusion Condition. 2. Attacking the Hold & Wait Condition. 3. Attacking the No Pre-emption Condition. 4. Attacking the Circular Wait Condition.
  • 6. Attacking the Mutual Exclusion Condition  Mutual Exclusion: For two processes, if any one process is accessing the common resource then the another process is excluded from accessing the resource.  Thus, each resource is either currently allocated to exactly one process or it is available for other process to access it. Two processes can’t simultaneously access the common resource.
  • 7. Example  It is clear that by allowing two processes to write on the printer simultaneously will lead to chaos.  Actually, the only process which requests the physical printer is the printer daemon.  Printer daemon never requests any other resource, so the deadlock can be eliminated and also it prints only after the complete o/p file is available.  But this could in itself lead to deadlock for two processes having finished their part, but not all, of their o/p, and can’t continue.  Thus, avoiding to assign a resource unless not absolutely necessary and try to make less processes request for the resource.
  • 8. Attacking the Hold & Wait Condition  Hold and Wait: In this scenario, processes currently holding resource can request new resource to complete its task.  If the process requests all the resources before starting the execution, deadlocks can be eliminated.  I.E. if everything is available, process will be allocated whatever it needs and can run to completion.  Whereas, if one or more of the requested resource is/are busy, then nothing will be allocated and the process would just wait for the resource to become free and enter the critical region.  The problem that how many resources does a process may need can’t be known until it has started running.
  • 9. Example  Consider a process, that reads data from an i/p tape, analyzes it for an hour, and then writes an o/p tape as well as plotting the results.  Thus, if all resources are requested in adv, the process will tie up the o/p tape and the plotter for an hour.  Thus, this method wastes the resources as for an hour no other process would be able to use the plotter and the o/p tape.
  • 10. Attacking the No Pre-emption Condition  No Pre-emption: Once a process holds a resource, it can’t be taken away by another process or the kernel and resource can only be voluntarily released by the process.  Example: if a process is assigned a printer and is in the middle of printing its output, forcibly taking away the printer because the plotter needed isn’t available is not possible.  Thus, a resource can be used only if the process holding it, releases it voluntarily.
  • 11. Attacking the Circular Wait Condition  Circular wait: Each process is waiting to obtain a resource which is held by another process.  The circular wait can be eliminated by a rule that if a process is holding a resource at the moment then it can’t request for other resource, and if it wants to access the other resource then it must release the first one.  Another way to avoid the circular wait is to provide a global numbering of all the resources.  A process can request whenever it wants, but all the request must be made in numerical order.
  • 12. Example  Consider the following resources numbered as below: 1. Image setter 2. Scanner 3. Plotter 4. Tape-Drive 5. CD-ROM drive. A process may request first a printer and then a tape drive, but it can’t request first a plotter and then a printer.
  • 13. Example  Here, if A requests for j ; i>j, then A is not allowed to request j because that is lower than what it already has.  Similarly, if B requests for i; i<j, then B is not allowed to request for i.  Thus, either way deadlock is not possible. A i B j