Deadlock and Distributed Deadlock Flashcards
4 necessary deadlock conditions
mutual exclusion
hold and wait
no preemption
circular wait
what is hold and wait
allowing processes to hold previously acquired resources while waiting for additional ones
3 deadlock handling strategies
deadlock prevention
deadlock avoidance
deadlock detection/recovery
2 types of resources
reusable resources
consumable resources
idea of Havender’s linear ordering scheme
- the idea is deadlock prevention by eliminating circular wait
- resources are ordered in some way by id or priority
- processes can only request resources of higher id or priority than they currently have. since resource request are uni-directional, circular-wait is impossible
The part of Banker’s algorithm I’m likely to forget
To find available resources sum up each column in “Allocated” and subtract from Total-Max
Max Resources for process = Allocation + Need
When you are checking to see if a request is safe, subtract request value from “Available”. Then look at need matrix to see if any of the processes can be completed (“Available” has greater than or equal to the number of resources of each kind that are needed by that process).
If a process can be completed, subtract the need from “Available”. Then add “Max” to available. Repeat process to determine if all processes can be completed.
if yes = safe
if no = not safe
Resource graph semantics
if a process node has a directed edge towards a resource node = request for that resource
edge from resource node to process node = process is holding that resource
system model
a set of assumptions to reduce the complexity of deadlock detection
- reusable resources only
- only exclusive access to resources (no concurrent use)
- each resource only has one instance (only one unit of each resource)
what is a wait-for graph? (WFG)
a resource graph without the resource nodes for simplicity
P1 –> P2 implies P1 –> R –> P2
centralize deadlock control algorithm
- control site maintains WFG of the entire system
- when a site requests or releases a resource it sends a message to the control site.
- each time the control site receives a message it updates the WFG and the inspects it to see if a deadlock is present