SlideShare a Scribd company logo
3
Most read
4
Most read
6
Most read
OVERVIEW OF DEADLOCK
(Part –I )
CONTENTS
What is Deadlock?
 Dead lock
Characterization
 Approaches of Dead Lock
•Dead ock
Prevention
•Deadlock Detection
•Deadlock
Avoidance
10/6/2021
2 Dr.M.Karthika AP/IT/MTNC
What is Deadlock?
 Deadlock is a situation that occurs in OS.
 Deadlocks are a set of blocked processes each
holding a resource and waiting to acquire a resource
held by another process.
 Deadlock is a common problem in multi-processing
where several processes share a specific type of
mutually exclusive resource known as a soft lock or
software.
10/6/2021
3 Dr.M.Karthika AP/IT/MTNC
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.
10/6/2021
4 Dr.M.Karthika AP/IT/MTNC
Example
In the below diagram, Process 1 is holding Resource 1 and waiting for
resource 2 which is acquired by process 2, and process 2 is waiting
for resource 1.
10/6/2021
5 Dr.M.Karthika AP/IT/MTNC
Deadlock Characterization
( four Coffman conditions )
1. Mutual Exclusion
A resource can only be shared in mutually exclusive
manner. It implies, if two process cannot use the same
resource at the same time.
2. Hold and Wait
A process waits for some resources while holding
another resource at the same time.
10/6/2021
6 Dr.M.Karthika AP/IT/MTNC
3. No preemption
The process which once scheduled will be executed till
the completion. No other process can be scheduled by
the scheduler meanwhile.
4. Circular Wait
All the processes must be waiting for the resources in a
cyclic manner so that the last process is waiting for the
resource which is being held by the first process.
10/6/2021
7 Dr.M.Karthika AP/IT/MTNC
There are three approaches to deal with deadlocks.
1. Deadlock Prevention
2. Deadlock avoidance
3. Deadlock detection
10/6/2021
8 Dr.M.Karthika AP/IT/MTNC
Deadlock Prevention
 The strategy of deadlock prevention is to design the
system in such a way that the possibility of deadlock
is excluded.
 Indirect method prevent the occurrence of one of three
necessary condition of deadlock i.e., mutual exclusion,
no pre-emption and hold and wait.
 Direct method prevent the occurrence of circular wait.
10/6/2021
9 Dr.M.Karthika AP/IT/MTNC
Prevention techniques
 Mutual exclusion
 Hold and Wait
 No pre-emption
10/6/2021
10 Dr.M.Karthika AP/IT/MTNC
Deadlock Detection
 Deadlock can be detected by the resource scheduler
as it keeps track of all the resources that are
allocated to different processes.
 After a deadlock is detected, it can be handed using
the given methods
All the processes that are involved in the deadlock are
terminated. This approach is not that useful as all the
progress made by the processes is destroyed.
Resources can be preempted from some processes
and given to others until the deadlock situation is
resolved. 10/6/2021
11 Dr.M.Karthika AP/IT/MTNC
Deadlock Avoidance
 It is better to avoid a deadlock rather than take
measures after the deadlock has occurred.
 The wait for graph can be used for deadlock
avoidance. This is however only useful for smaller
databases as it can get quite complex in larger
databases.
10/6/2021
12 Dr.M.Karthika AP/IT/MTNC
 A decision is made dynamically whether the current
resource allocation request will, if granted, potentially
lead to deadlock.
 It requires the knowledge of future process requests.
 Two techniques to avoid deadlock :
 Process initiation denial
 Resource allocation denial
10/6/2021
13 Dr.M.Karthika AP/IT/MTNC
Advantages :
 Not necessary to pre-empt and rollback processes
 Less restrictive than deadlock prevention
Disadvantages :
 Future resource requirements must be known in
advance
 Processes can be blocked for long periods
 Exists fixed number of resources for allocation
10/6/2021
14 Dr.M.Karthika AP/IT/MTNC
Thank You
10/6/2021
15 Dr.M.Karthika AP/IT/MTNC

More Related Content

PPTX
PPTX
Unit 3 sp assembler
PPSX
Files in c++
PDF
PDF
Introduction to c++ ppt 1
PPT
Files in c++ ppt
PPTX
Macro Processor
PPT
Deadlock Detection
Unit 3 sp assembler
Files in c++
Introduction to c++ ppt 1
Files in c++ ppt
Macro Processor
Deadlock Detection

What's hot (20)

PPTX
Loaders ( system programming )
PDF
loaders and linkers
PPTX
Linux commands
PPTX
Ch 4 linker loader
PDF
Java - File Input Output Concepts
PPTX
Paging and segmentation
PPTX
The origin and evaluation criteria of aes
PPTX
System Programming Unit II
PPTX
Methods for handling deadlock
PPT
Java packages
PPTX
System Programming- Unit I
PPTX
PPTX
Principle source of optimazation
PPTX
Stream classes in C++
PDF
Control Flow Graphs
PDF
Basic Computer Organization and Design
PPTX
Variations Of Two Phase Locking
PPTX
Call by value and call by reference in java
PPTX
Inheritance in OOPs with java
PPTX
Introduction to loaders
Loaders ( system programming )
loaders and linkers
Linux commands
Ch 4 linker loader
Java - File Input Output Concepts
Paging and segmentation
The origin and evaluation criteria of aes
System Programming Unit II
Methods for handling deadlock
Java packages
System Programming- Unit I
Principle source of optimazation
Stream classes in C++
Control Flow Graphs
Basic Computer Organization and Design
Variations Of Two Phase Locking
Call by value and call by reference in java
Inheritance in OOPs with java
Introduction to loaders
Ad

Similar to Overview of Deadlock unit 3 part 1 (20)

PPTX
Deadlocks and Deadlock Detection Other Issues
PPTX
Deadlocks
PPTX
Unit iv: Deadlocks
PPTX
Deadlocks2
PPTX
Lecture 4 Deadlocks in operating systems.pptx
PPTX
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
PPTX
Deadlock detection & prevention
PPTX
Algorithm 4Chapter Four- Deadlock (5).pptx
PPTX
dead lock in operating system Presentation1.pptx
PPTX
Deadlocks
PPTX
Deadlock-Prevention.pptx.jdk.kdos.odkwk.
PPTX
DistributedDeadlock on distriburtedNetwork.pptx
PPTX
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
PDF
Unit 3 part 2(DEADLOCK)
PPTX
DEADLOCK PREVENTION AND AVOIDANCE.pptx
PPTX
Deadlock Avoidance in Operating System
PPTX
Deadlocks
PPT
A ppt on deadlock in operating systems for the better explanation
Deadlocks and Deadlock Detection Other Issues
Deadlocks
Unit iv: Deadlocks
Deadlocks2
Lecture 4 Deadlocks in operating systems.pptx
Os presentation final.pptxjjjjjdakajwsjjdhdfjff
Deadlock detection & prevention
Algorithm 4Chapter Four- Deadlock (5).pptx
dead lock in operating system Presentation1.pptx
Deadlocks
Deadlock-Prevention.pptx.jdk.kdos.odkwk.
DistributedDeadlock on distriburtedNetwork.pptx
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Unit 3 part 2(DEADLOCK)
DEADLOCK PREVENTION AND AVOIDANCE.pptx
Deadlock Avoidance in Operating System
Deadlocks
A ppt on deadlock in operating systems for the better explanation
Ad

More from Dr.M.Karthika parthasarathy (20)

PDF
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
DOC
Linux Lab Manual.doc
PDF
DOCX
PPTX
Unit 1 Introduction to Artificial Intelligence.pptx
DOCX
Unit I What is Artificial Intelligence.docx
PPTX
Introduction to IoT - Unit II.pptx
PDF
DOCX
Chapter 3 heuristic search techniques
DOCX
Ai mcq chapter 2
PPTX
Introduction to IoT unit II
PPTX
Introduction to IoT - Unit I
PDF
Internet of things Unit 1 one word
DOCX
PPTX
Examples in OS synchronization for UG
PPTX
Process Synchronization - Monitors
DOCX
.net progrmming part4
DOCX
.net progrmming part3
DOCX
.net progrmming part1
DOCX
.net progrmming part2
IoT Enabled Wireless Technology Based Monitoring and Speed Control of Motor U...
Linux Lab Manual.doc
Unit 1 Introduction to Artificial Intelligence.pptx
Unit I What is Artificial Intelligence.docx
Introduction to IoT - Unit II.pptx
Chapter 3 heuristic search techniques
Ai mcq chapter 2
Introduction to IoT unit II
Introduction to IoT - Unit I
Internet of things Unit 1 one word
Examples in OS synchronization for UG
Process Synchronization - Monitors
.net progrmming part4
.net progrmming part3
.net progrmming part1
.net progrmming part2

Recently uploaded (20)

PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
RMMM.pdf make it easy to upload and study
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
human mycosis Human fungal infections are called human mycosis..pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Types and Its function , kingdom of life
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Pharma ospi slides which help in ospi learning
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
RMMM.pdf make it easy to upload and study
Anesthesia in Laparoscopic Surgery in India
O7-L3 Supply Chain Operations - ICLT Program
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
STATICS OF THE RIGID BODIES Hibbelers.pdf
Computing-Curriculum for Schools in Ghana
Module 4: Burden of Disease Tutorial Slides S2 2025
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
GDM (1) (1).pptx small presentation for students
Abdominal Access Techniques with Prof. Dr. R K Mishra
Microbial diseases, their pathogenesis and prophylaxis
Pharmacology of Heart Failure /Pharmacotherapy of CHF

Overview of Deadlock unit 3 part 1

  • 2. CONTENTS What is Deadlock?  Dead lock Characterization  Approaches of Dead Lock •Dead ock Prevention •Deadlock Detection •Deadlock Avoidance 10/6/2021 2 Dr.M.Karthika AP/IT/MTNC
  • 3. What is Deadlock?  Deadlock is a situation that occurs in OS.  Deadlocks are a set of blocked processes each holding a resource and waiting to acquire a resource held by another process.  Deadlock is a common problem in multi-processing where several processes share a specific type of mutually exclusive resource known as a soft lock or software. 10/6/2021 3 Dr.M.Karthika AP/IT/MTNC
  • 4. 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. 10/6/2021 4 Dr.M.Karthika AP/IT/MTNC
  • 5. Example In the below diagram, Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1. 10/6/2021 5 Dr.M.Karthika AP/IT/MTNC
  • 6. Deadlock Characterization ( four Coffman conditions ) 1. Mutual Exclusion A resource can only be shared in mutually exclusive manner. It implies, if two process cannot use the same resource at the same time. 2. Hold and Wait A process waits for some resources while holding another resource at the same time. 10/6/2021 6 Dr.M.Karthika AP/IT/MTNC
  • 7. 3. No preemption The process which once scheduled will be executed till the completion. No other process can be scheduled by the scheduler meanwhile. 4. Circular Wait All the processes must be waiting for the resources in a cyclic manner so that the last process is waiting for the resource which is being held by the first process. 10/6/2021 7 Dr.M.Karthika AP/IT/MTNC
  • 8. There are three approaches to deal with deadlocks. 1. Deadlock Prevention 2. Deadlock avoidance 3. Deadlock detection 10/6/2021 8 Dr.M.Karthika AP/IT/MTNC
  • 9. Deadlock Prevention  The strategy of deadlock prevention is to design the system in such a way that the possibility of deadlock is excluded.  Indirect method prevent the occurrence of one of three necessary condition of deadlock i.e., mutual exclusion, no pre-emption and hold and wait.  Direct method prevent the occurrence of circular wait. 10/6/2021 9 Dr.M.Karthika AP/IT/MTNC
  • 10. Prevention techniques  Mutual exclusion  Hold and Wait  No pre-emption 10/6/2021 10 Dr.M.Karthika AP/IT/MTNC
  • 11. Deadlock Detection  Deadlock can be detected by the resource scheduler as it keeps track of all the resources that are allocated to different processes.  After a deadlock is detected, it can be handed using the given methods All the processes that are involved in the deadlock are terminated. This approach is not that useful as all the progress made by the processes is destroyed. Resources can be preempted from some processes and given to others until the deadlock situation is resolved. 10/6/2021 11 Dr.M.Karthika AP/IT/MTNC
  • 12. Deadlock Avoidance  It is better to avoid a deadlock rather than take measures after the deadlock has occurred.  The wait for graph can be used for deadlock avoidance. This is however only useful for smaller databases as it can get quite complex in larger databases. 10/6/2021 12 Dr.M.Karthika AP/IT/MTNC
  • 13.  A decision is made dynamically whether the current resource allocation request will, if granted, potentially lead to deadlock.  It requires the knowledge of future process requests.  Two techniques to avoid deadlock :  Process initiation denial  Resource allocation denial 10/6/2021 13 Dr.M.Karthika AP/IT/MTNC
  • 14. Advantages :  Not necessary to pre-empt and rollback processes  Less restrictive than deadlock prevention Disadvantages :  Future resource requirements must be known in advance  Processes can be blocked for long periods  Exists fixed number of resources for allocation 10/6/2021 14 Dr.M.Karthika AP/IT/MTNC