21. Deadlock Management Flashcards
1
Q
Deadlock
A
- The permanent blocking of a set of processes that either compete for system resources or communicate with each other
2
Q
Process-Resource Dependency Graph
A
- Processes and resources are nodes
- An edge exists from a process to a resource if the process is requesting that resource
- An edge exists from a resource to a process if that process has already acquired the resource
- A deadlock occurs when there is a loop in the graph
3
Q
Necessary and Sufficient Conditions for Deadlock
A
- Multiple processes sharing multiple resources
- Resources have limited capacity
- Processes may hold some resources while waiting for others
- A closed chain of dependency in the process-resource graph
4
Q
Flaw of Deadlock Prevention
A
- Change the system so that conditions do not hold
- Not a practical solution
5
Q
Flaw of Deadlock Detection & Recovery
A
- Detect loops in graph and break them
- Hard to detect a lack of progress and reconstruct the dependency graph
6
Q
Flaw of Deadlock Avoidance
A
- Do not entire a doomed state in the first place
- Processes may be stalled unnecessarily
7
Q
Banker Algorithm
A
- Given a request for process i and resource k
- Assume we grant the request
- Recalculate available resources and remaining needs
- Check if the system can finish execution in this configuration
8
Q
Banker Algorithm R(k)
A
- The total amount of resource R_{k} in the system
9
Q
Banker Algorithm C_{i}(k)
A
- The total amount of resource R_{k} that process P_{i} will ever need
10
Q
Banker Algorithm A_{i}(k)
A
- The total amount of resource R_{k} currently allocated to process P_{i}
11
Q
Banker Algorithm V(k)
A
- The total amount of resource R_{k} currently available
- Equal to the total minus the sum of the current allocation
12
Q
Banker Algorithm N_{i}(k)
A
- The total amount of resource R_{k} currently needed by process P_{i} to complete its execution
13
Q
Limitations of the Banker Algorithm
A
- There may exist a state that would not lead to a deadlock that is deemed unsafe by the algorithm
- Deadlocks are still possible if processes declare inexact values of C_{i}(k) or if there are hidden shared resources