SlideShare a Scribd company logo
 ᗩᔕ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

Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock GalvinSonali Chauhan
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
Sara Ali
 
Deadlock Presentation
Deadlock PresentationDeadlock Presentation
Deadlock Presentation
salmancreation
 
Bankers
BankersBankers
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidancewahab13
 
Deadlock Avoidance in Operating System
Deadlock Avoidance in Operating SystemDeadlock Avoidance in Operating System
Deadlock Avoidance in Operating System
Mohammad Hafiz-Al-Masud
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
Vandana Salve
 
Deadlock
DeadlockDeadlock
Deadlock
Sajan Sahu
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
prachi mewara
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
Chetan Mahawar
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
IkhtiarUddinShaHin
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
Ali Ahmad
 
Deadlock
DeadlockDeadlock
Deadlock
Rajandeep Gill
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
EktaVaswani2
 
Process of operating system
Process of operating systemProcess of operating system
deadlock handling
deadlock handlingdeadlock handling
deadlock handling
Suraj Kumar
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlockstech2click
 

What's hot (20)

Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock Galvin
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlock Presentation
Deadlock PresentationDeadlock Presentation
Deadlock Presentation
 
Deadlock
DeadlockDeadlock
Deadlock
 
Bankers
BankersBankers
Bankers
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
Deadlock Avoidance in Operating System
Deadlock Avoidance in Operating SystemDeadlock Avoidance in Operating System
Deadlock Avoidance in Operating System
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
 
Process synchronization
Process synchronizationProcess synchronization
Process synchronization
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock and memory management -- Operating System
Deadlock and memory management -- Operating SystemDeadlock and memory management -- Operating System
Deadlock and memory management -- Operating System
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handling
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 

Similar to Deadlock in Operating System

Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
madhuributani
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
ushabarad142
 
6. Deadlock_1640227623705.pptx
6. Deadlock_1640227623705.pptx6. Deadlock_1640227623705.pptx
6. Deadlock_1640227623705.pptx
shrijanasharma3
 
Module 3 Deadlocks.pptx
Module 3 Deadlocks.pptxModule 3 Deadlocks.pptx
Module 3 Deadlocks.pptx
shreesha16
 
Deadlocks Part- I.pdf
Deadlocks Part- I.pdfDeadlocks Part- I.pdf
Deadlocks Part- I.pdf
Harika Pudugosula
 
OS Module-3 (2).pptx
OS Module-3 (2).pptxOS Module-3 (2).pptx
OS Module-3 (2).pptx
KokilaK25
 
OS 7.pptx
OS 7.pptxOS 7.pptx
OS 7.pptx
ZainabShahzad9
 
osvzjsjjdndnnssnnsnsndndndnndeadlock.pptx
osvzjsjjdndnnssnnsnsndndndnndeadlock.pptxosvzjsjjdndnnssnnsnsndndndnndeadlock.pptx
osvzjsjjdndnnssnnsnsndndndnndeadlock.pptx
Bhaskar271887
 
4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx4.3 Deadlock [Autosaved].pptx
4.3 Deadlock [Autosaved].pptx
DishaDwivedi2
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
JeelBhanderi4
 
deadlocks.pptx
deadlocks.pptxdeadlocks.pptx
deadlocks.pptx
JOHNZHOU52
 
Deadlock
DeadlockDeadlock
Deadlock
Rajapriya82
 
Deadlock
DeadlockDeadlock
Deadlock
Rajapriya82
 
OS Presentation 1 (1).pptx
OS Presentation 1 (1).pptxOS Presentation 1 (1).pptx
OS Presentation 1 (1).pptx
FahadAbdullah84
 
Chapter5_Deadlock.pptx
Chapter5_Deadlock.pptxChapter5_Deadlock.pptx
Chapter5_Deadlock.pptx
DenisPriscus
 
chapter06-new.pptx
chapter06-new.pptxchapter06-new.pptx
chapter06-new.pptx
Umesh Hengaju
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlockwahab13
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
Shipra Swati
 
24 to 25 deadlockprevention
24 to 25 deadlockprevention24 to 25 deadlockprevention
24 to 25 deadlockpreventionmyrajendra
 

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

在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
Kamal Acharya
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
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
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
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
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 

Recently uploaded (20)

在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Online aptitude test management system project report.pdf
Online aptitude test management system project report.pdfOnline aptitude test management system project report.pdf
Online aptitude test management system project report.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
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
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
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
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 

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.