Deadlocks in operating system

10,181 views

Published on

This slide is about how deadlocks occur,its characterizatio prevention avoidance & recovery.

Published in: Education, Technology
0 Comments
21 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
10,181
On SlideShare
0
From Embeds
0
Number of Embeds
63
Actions
Shares
0
Downloads
741
Comments
0
Likes
21
Embeds 0
No embeds

No notes for slide

Deadlocks in operating system

  1. 1. DEADLOCKS INOPERATING SYSTEM
  2. 2. OPERATING SYSTEMPresented by :Wajiha SiddiquiSara AliAisha Hameed
  3. 3. 1. The Deadlock Problem2. Deadlock Characterization3. Deadlock Modeling4. Resource Allocation Graph5. Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection Recovery from Deadlock
  4. 4. WHAT ARE DEADLOCKS???A set of blocked processes eachholding a resource and waiting toacquire a resource held by anotherprocess in the set.o Example Process-1 requests the printer, gets it Process-2 requests the tape unit, gets it Process-1 and Process-1 requests the tape unit, waits Process-2 are Process-2 requests the printer, waits deadlocked!
  5. 5. FOUR CONDITIONS FOR DEADLOCKS???1. Mutual Exclusion Condition2. Hold & Wait Condition3. No Preemption Condition4. Circular Wait Condition
  6. 6. DEADLOCK MODELING???Modeled with directed graphs
  7. 7. HOW DEADLOCKS OCCUR?
  8. 8. HOW DEADLOCKS CAN BE AVOIDED???
  9. 9. RESOURCE ALLOCATION GRAPHS??? CIRCLES represents processes SQUARE represents classes of identical resources SMALL SQUARES DRAWN INSIDE LARGE SQUARES Indicate separate identical resources of each class
  10. 10.  If the resource allocation graph contains no cycles then there isno deadlock in the system at that instance. If there is a cycleo If there is only one instance per resource type than there is a deadlocko If there is more than once instance for some resource type than there mayor may not be a deadlock
  11. 11. EXAMPLE OF A RESOURCE ALLOCATION GRAPH
  12. 12. HOW TO HANDLE DEADLOCKS???• Four major areas of interest in deadlock research- Deadlock Prevention- Deadlock Avoidance- Deadlock Detection- Deadlock Recovery
  13. 13. DEADLOCK PREVENTION???• Prevention eliminates one of four conditions1. Elimination Of Mutual Exclusion2. Elimination Of Hold & Wait Condition3. Elimination Of No Preemption Condition4. Elimination Of Circular Wait Condition
  14. 14. DEADLOCK AVOIDANCE???• Maximum requirements ofeach resource must be statedin advance by each process.• Two Approaches• Two Algorithmso Resource Allocation Algorithmso The Banker’s Algorithm
  15. 15. DEADLOCK DETECTION???• Determines if deadlock has occurred• Identifies those processes & resourcesinvolved in the deadlock• Algorithms can incur significantruntime overhead
  16. 16. RECOVERY FROM DEADLOCKS???• Process Terminationo Abort all deadlocked processes.o Abort one process at a time untilthe deadlock cycle is eliminated.• Resource Preemptiono Selecting a victimo Rollbacko Starvation

×