12 - Deadlock Characterization Deadlock can arise if four...

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

View Full Document Right Arrow Icon
Deadlock Characterization Mutual exclusion: only one process at a time can use a resource. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. 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 { P 0 , P 1 , …, P n } of waiting processes such that P 0 is waiting for a resource that is held by P 1 , P 1 is waiting for a resource that is held by. P 2 , …, P n –1 is waiting for a resource that is held by P n , and P n is waiting for a resource that is held by P 0 . Deadlock can arise if four conditions hold simultaneously.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Resource-allocation Graph V is partitioned into two types: P = { P 1 , P 2 , …, P n }, the set consisting of all the processes in the system. R = { R 1 , R 2 , …, R m }, the set consisting of all resource types in the system Request edge – directed edge P 1 R j Assignment edge – directed edge R j p i A set of vertices V and a set of edges E .
Background image of page 2
Resource-Allocation Graph (Cont.) Process Resource Type with 4 instances P i requests instance of R j P i is holding an instance of R j P i P i R j R j
Background image of page 3

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

View Full DocumentRight Arrow Icon
Example of a Resource Allocation Graph
Background image of page 4
Resource Allocation Graph With A Deadlock
Background image of page 5

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

View Full DocumentRight Arrow Icon
Resource Allocation Graph With A Cycle But No Deadlock
Background image of page 6
Basic Facts If graph contains no cycles no deadlock. If graph contains a cycle If only one instance per resource type, then deadlock If several instances per resource type, possibility of deadlock
Background image of page 7

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

View Full DocumentRight Arrow Icon
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
Background image of page 8
Deadlock Prevention Mutual exclusion – not required for sharable resources; Must hold for nonsharable 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 Restrain the ways request can be made.
Background image of page 9

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

View Full DocumentRight Arrow Icon
No preemption If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released Preempted resources are added to the list of resources for which the process is waiting Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting. Circular wait
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/14/2010 for the course CSE SSZG516 taught by Professor Muralip during the Summer '10 term at Birla Institute of Technology & Science.

Page1 / 36

12 - Deadlock Characterization Deadlock can arise if four...

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

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