Deadlock detection and recovery by saad symbian


Published on

Deadlock detection and recovery

Published in: Technology
1 Comment
  • symbian g ...... very nice presentation..... i hope you got good marks due to good theme and layout and having a nice animation...... i have enjoyed all the presentation......thanx..... saad Symbian
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Deadlock detection and recovery by saad symbian

  1. 1. Presented by :Saad WazirBS-CSREG# 1421-212019 PRESTON Thursday , August 09, 2012 University
  2. 2. Deadlock Definition : There exists a cycle of processes such that each process cannot proceed until the next process takes some specific action. Result: all processes in the cycle are stuck! P1 R2 R1 P2
  3. 3. Deadlock solutions:- Prevention :• Design system so that deadlock is impossible- Avoidance :• Steer around deadlock with smart scheduling- Detection & recovery :• Check for deadlock periodically• Recover by killing a deadlocked processes and releasing its resources- Do nothing :• Prevention, avoidance and detection/recovery are expensive• Manual intervention (kill processes, reboot) if needed
  4. 4. Deadlock Prevention:#1: No mutual exclusion• only one process at a time can use a resource.#2: no preemption• previously granted resources cannot forcibly taken away.#3: No hold and wait• When waiting for a resource, must not currently hold any resource#4: circular wait condition• Must be A circular chain of 2 or more processes• When Waiting For Resource Must Not Currently Hold Any Resource
  5. 5. Over View OF Deadlock Detection & Recovery :
  6. 6. Deadlock Detection :Check to see if a deadlock has occurred!- Special case: Single resource per type• E.g., mutex locks (value is zero or one)• Check for cycles in the resource allocation graph- General case• E.g., semaphores, memory pages, ...
  7. 7. Dependencies B/W processes: CorrespondingResource allocation graph process dependency graph
  8. 8. Deadlock Recovery:Recovery idea: get rid of the cycles inthe process dependency graphOptions:• Kill all deadlocked processes.• Kill one deadlocked process at a time andrelease its resources.• Steal one resource at a time.• Roll back all or one of the processes toSafe state.
  9. 9. Deadlock Recovery: Only have to Have to kill kill one one more Corresponding Process dependency graph
  10. 10. Deadlock Recovery: How should we pick a process to kill? We might consider... • process priority • current computation time and time to completion • amount of resources used by the process • amount of resources needed by the process to complete • is process interactive or batch?
  11. 11. Rollback instead of killing processes: Selecting a victim • Minimize cost of rollback (e.g., size of process’s memory). Rollback • Return to some safe state • Restart process for that state Note: Large, long computations are sometimes checkpointed for other reasons (reliability) anyway
  12. 12. Deadlock Summary: Deadlock: cycle of processes/threads each waiting for the next • Nasty timing-dependent bugs! Detection & Recovery • Typically very expensive to kill / checkpoint processes Avoidance: steer around deadlock • Requires knowledge of everything an application will request • Expensive to perform on each scheduling event
  13. 13. Hope you enjoy & learn something  Special Thanks to :Philip GodfreyCS 241University of Illinois Fahad Wazir (Little Brother) , kamran Shah & Mian Abdul PRESTON Thursday , August 09, 2012 University