Next: Chapter 9: Disributed File
Up: No Title
Previous: Chapter 5: Theoretical Foundations
Single-Unit Request Model
- process restricted to requesting only one unit of request at
a time.
- out degree of nodes in Wait-for-graph (WFG) is at most one.
- if only one unit of every resource in system, deadlock corresponds to
a cycle in WFG.
AND Request Model
- a process can simultaneously request multiple resources.
- process blocked until all requests are granted.
- if single copy of every resource in sytem, cycle implies deadlock.
- process may be concurrently involved in multiple deadlocks.
- single-unit request model is a special case of the AND model.
OR Request Model
- process can simultaneously request multiple resources.
- blocked until any one of the requested resources is granted.
- cycle in WFG is not a sufficient condition for deadlock even if only
one copy of each resource is present.
- presence of a knot is a sufficient condition for deadlock.
Knot: subgraph such that starting from any node in the subgraph
it is impossible to leave the knot following the edges of the graph.
AND-OR Request Model
- generalization of the AND and the OR models.
- knot is a sufficient condition for deadlock.
P-out-of-Q Request model.
Resource Types
Reusable resources: do not vanish after use
- fixed number of units of resource
- neither created, nor destroyed.
Consumable resources: vanish on use
- no fixed number of units of resource
- one or more producers of resource
- producer, if not blocked, can produce any number of units of resource.
General Resource Graph (GRG)
- a bi-partite graph with the following edges:
- request edge: directed from a process P to resource R
- assignment edge: directed from reusable resource R to process P
- producer edge: directed from consumable resource to its producer
process.
General Resource Graph (contd.)
For every reusable resource:
- number of assignment edges
number of units of the resource.
- available units = total units - assigned units.
- a process can never request more than total units of a resource.
For every consumable resource:
- an edge from Ri to Pj if Pj is a producer of Ri.
- available units
0
Operations on GRG
- Request:
- draw corresponding number of request edges (e).
- Acquisition:
-
units of Rj available:
- if reusable resource Rj: replace request edge with assignment edge
- if consumable resource Rj: remove all e request edges.
decrement rj by e - Release:
- performed by process with no outstanding request
- if reusable resource: remove assignment edge(s), increment
rj.
- if consumable resource: rj can be increased by any number.
GRG Reduction Method
Blocked process: whose requests for any resource exceed the number
of available units of that resource.
Graph reduction method: by unblocked process Pi
- for each reusable resource Rj: reduce the request and assignment
edges between Pi and Rj
- for each consumable resource Rj:
- decrement rj by number of request edges
- if Pi is producer of Rj: set rj to
- delete all edges between Pi and Rj
Deadlock Determination by Reduction
- A graph is completely reducible if a sequence of reductions delete
all edges in the graph.
- Theorem: Process Pi is not deadlocked if reductions leave it
in an unblocked state.
- Corollary: A system is deadlock free if its GRG is completely
reducible.
However, lack of reducibility does not necessarily indicate the system is
deadlocked.
Deadlock Detection
Expedient state: all processes with outstanding requests are blocked.
Theorem: In a general resource graph:
- a cycle is a necessary condition for deadlock.
- if the graph is expedient, a knot is a sufficient condition for a
deadlock.
However, absence of a deadlock does not necessarily imply the absence of
deadlock.
Theorem: An expedient GRG with single-unit requests represents a
deadlock state if and only if it contains a knot.
Next: Chapter 9: Disributed File
Up: No Title
Previous: Chapter 5: Theoretical Foundations
Ravi Prakash
2000-04-22