20091210 - Deadlocks A process is deadlocked if it is...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Deadlocks A process is deadlocked if it is waiting for a particular event that will never occur. In an OS, deadlocks may be possible whenever a process blocks awaiting resources (memory, files, entries in kernel tables, swap space, etc .) Real-life Example: Gridlock Gridlock occurs when automobiles traversing intersections get stuck in such a way that each is blocked by the other. Starts locally. Once started, can spread quickly. Recovery: very expensive. Avoidance Strategy: Dont block the box! Traffic Gridlock An Anecdote: Handin Program Deadlock Characteristics Deadlocks are characterized by an unresolvable circular wait condition, in which each process in a set D is waiting for a resource held by some other process in D . Necessary Conditions for Deadlock (Coffman and Denning) 1. Mutual Exclusion Each process claims exclusive control of the resources it uses. 2. Non-preemption A process does not release resources it holds until it completes its use of them. 3. Hold-and-wait Each process holds resources while wait- ing for the others to release resources. Possible Approaches to Deadlocks Avoidance (pessimistic): Try to deny one of the neccesary conditions for deadlock. Detection and Recovery (optimistic): Identify deadlocks by looking for the characteristic circular wait condition. Recover by breaking the cycle ( how? ). Safe, Unsafe, and Deadlock States Consider processes P 1 and P 2 each of which requires the exclusive use of resource R 1 and R 2 during some portion of its execution. We can represent the execution constraints graphically. The system trajectory must avoid the infeasible region , because the mutual exclusion constraints are violated there. Entering the unsafe region will inevitably lead to dead- lock....
View Full Document

Page1 / 34

20091210 - Deadlocks A process is deadlocked if it is...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online