Operating Systems Ch. 7 Deadlock
Recovery (from deadlock)
When a deadlock is detected the system will have this which involves either killing one or more processes to break the deadlock or to preempt some resources from one or more of the deadlocked processes.
Request (on a resource)
When a process asks to use a resource. Sometimes this cannot be granted immediately and if so the process must wait until it can have the resource.
Release (on a resource)
When a process no longer needs a resource it will do this.
Deadlock
When a process requests resources, and those resources are already in use the process enters the waiting state. If the process is never able to change states because the resources requested are held by other waiting processes we have this.
Request Edge
A directed edge from a process to a resource is called this.
Assignment Edge
A directed edge from a resource to a process is called this.
Resource Allocation graph
A directed graph that consists of a set of vertices V, and a set of edges E. The vertices are either resources or processes.
Hold and Wait (as a necessary condition for deadlock)
A process must be in possession of one resource and wanting to acquire additional resources that are currently in possession of other process.
Circular Wait (as a necessary condition for deadlock)
A set of processes {P0, P1, ..., Pn-1, Pn} must exist such that P0 is waiting for a resource held by P1, P1 is waiting for a resource held by P2, ..., Pn-1 is waiting for resource held by Pn and Pn is waiting for a resource held by P0.
Safe State (in deadlock avoidance)
A state is this if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock.
Mutual exclusion (as a necessary condition for deadlock)
At least one resource must be held in a non-sharable mode; that is, only one process at a time can use the resource. If another process requests that resource, the requesting process must be delayed until the resource has been released.
Rollback (in deadlock recovery)
If we decide to preempt resources for our recovery we must decide what to do with that process. So we must make the process go back to some safe state so it can be restarted again. The described process is called this.
Unsafe State (in deadlock avoidance)
If you're in this state you may not be in deadlock, but you could be in the future. If we are in this state the responsibility of whether or not we end up in deadlock is up to the processes, and out of the operating system's control.
No preemption (as a necessary condition for deadlock)
Resources can only be released if the process holding it releases it, or after the process has completed its task of using that resource.
Necessary conditions (for deadlock)
The following four things are what is needed for deadlock: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait.
Use (on a resource)
The process can operate on the resource. ex. If a process has the printer it can then print.
Deadlock Detection
This contains an algorithm that examines the state of the system to determine whether a deadlock has occurred, and another algorithm to recover from deadlock.
Wait-for graph
This is a variation of the resource-allocation graph, this graph has no resources in the graph but rather the edges point from process to process. Ex. If P1 points to P2 that implies that P1 is waiting for P2 to release a resource that P1 needs.
Banker's Algorithm
This is an algorithm that states when a new process enters the system it must declare the maximum number of instances of each resource type that it may need. The number may not exceed the total number of resources in the system. When a user requests a set of resources, the system must determine whether the allocation of these resources will leave the system in a safe state. If it will the resources are allocated and if not the resources are not allocated, and the process must wait.
Claim Edge
This is an edge that indicates a Process P may ask for a Resource R in the future.
Victim Selection (in deadlock recovery)
This is what we call when we choose what processes that we need to kill to break deadlock. When do this we must consider cost factors that may include number of resources a deadlocked process is holding and the amount of time the process has consumed.
Deadlock Prevention
This provides a set of methods to ensure that at least one of the necessary conditions will not hold true.
Deadlock Avoidance
This requires that the operating system be given additional information in advance concerning which resources a process will request and use during its life time.