Deadlocks in operating system

  • 1,834 views
Uploaded on

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

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

More in: Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,834
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
140
Comments
0
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. DEADLOCKS INOPERATING SYSTEM
  • 2. OPERATING SYSTEMPresented by :Wajiha SiddiquiSara AliAisha Hameed
  • 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. 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. FOUR CONDITIONS FOR DEADLOCKS???1. Mutual Exclusion Condition2. Hold & Wait Condition3. No Preemption Condition4. Circular Wait Condition
  • 6. DEADLOCK MODELING???Modeled with directed graphs
  • 7. HOW DEADLOCKS OCCUR?
  • 8. HOW DEADLOCKS CAN BE AVOIDED???
  • 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.  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. EXAMPLE OF A RESOURCE ALLOCATION GRAPH
  • 12. HOW TO HANDLE DEADLOCKS???• Four major areas of interest in deadlock research- Deadlock Prevention- Deadlock Avoidance- Deadlock Detection- Deadlock Recovery
  • 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. 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. DEADLOCK DETECTION???• Determines if deadlock has occurred• Identifies those processes & resourcesinvolved in the deadlock• Algorithms can incur significantruntime overhead
  • 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