Deadlocks Flashcards
(73 cards)
What is a deadlock?
A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause.
In the example of deadlocks, what do processes P1 and P2 hold and need?
Each holds one disk drive and each needs another one.
What is a process considered if it is waiting for an event that will never occur?
A process is deadlocked.
What does it mean for a process to be indefinitely postponed?
A process is delayed repeatedly over a long period while attention is given to other processes.
What are the types of resource models mentioned?
Resource types R1, R2, …, Rn with each resource type Ri having Wi instances.
What are the four necessary conditions for a deadlock to occur?
- Mutual exclusion
- Hold and wait
- No preemption
- Circular wait
What is mutual exclusion in the context of deadlocks?
Only one process at a time can use a resource.
What does ‘hold and wait’ mean?
A process holding at least one resource is waiting to acquire additional resources held by other processes.
What is the no preemption condition?
A resource can only be released voluntarily by the process holding it.
Define circular wait.
A set of waiting processes exists such that each process is waiting for a resource held by the next process in the chain.
What is a Resource-Allocation Graph?
A set of vertices V and a set of edges E, partitioned into processes and resource types.
What are the two types of edges in a Resource-Allocation Graph?
- Request edge: directed edge Pi → Rj
- Assignment edge: directed edge Rj → Pi
If a Resource-Allocation Graph contains no cycles, what does this imply?
No deadlock.
What happens if a graph contains a cycle with only one instance per resource type?
Deadlock occurs.
What is one method for handling deadlocks?
Ensure that the system will never enter a deadlock state.
What does deadlock prevention involve?
Designing the system to ensure that at least one of the necessary conditions cannot hold.
What is deadlock avoidance?
The system dynamically considers every request and decides whether it is safe to grant it.
What does deadlock detection entail?
Allowing the possibility of deadlock and determining if it has occurred and which processes and resources are involved.
What is recovery in deadlock management?
Clearing the problem after detection, allowing processes to complete and resources to be reused.
What is the implication of denying any one of the conditions for deadlock?
Deadlock is impossible.
What does the hold and wait condition guarantee?
When a process requests a resource, it does not hold other resources.
What is the outcome of forcing each process to acquire all required resources at once?
Low resource utilization and possible starvation.
How does no preemption apply to deadlock prevention?
Preempt resources from a process and add them to the list of resources for which the process is waiting.
What is the purpose of imposing a total ordering of all resource types?
To prevent circular wait.