Deadlock Flashcards
-System consists of resources
-resource types R1, R2…,Rm
–CPU cycles, memory space, I/O devices
-each resource type Ri has Wi instances.
-each process utilizes a resource as follows:
–request
–use
–release
system model
(deadlock characterization)
-only one process at a time can use a resource
(deadlock prevention)
-not required for sharable resources (e.g., read-only files); must hold for non-sharable resources.
mutual exclusion
(deadlock characterization)
-a process holding at least one resource is waiting to acquire additional resources held by other processes.
(deadlock prevention)
-must gurantee 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 allocated to it.
–low resource utilization; starvation possible.
hold and wait
(deadlock characterization)
-a resource can be released only voluntarily by the process holding it, after that process has completed its task.
(deadlock prevention)
-if a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currecntly 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.
no preemption
-(deadlock characterization)
-there exists a set of waiting processes such that P0 is waiting for a resource that is held by P1. P1 is waiting for a resource that is held by P2, …, Pn-1, is waiting for a resource that is held by Pn, and Pn is waiting for a resource that is held by P0.
(deadlock prevention)
-impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration.
circular wait
-simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need.
-dynamically examines the resource-allocation state to ensure that there can never be a circular-wait condition.
deadlock avoidance
-is defined by the number of available and allocated resources, and the maximum demands of the processes.
resoruce-allocation state
safe state