Jump to content

Wait-for graph

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by David Eppstein (talk | contribs) at 23:50, 22 November 2017 (Undo good faith edit. What is the point of giving the resource a variable name and then not using that variable? It only makes the text more WP:TECHNICAL.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A wait-for graph in computer science is a directed graph used for deadlock detection in operating systems and relational database systems.

In computer science, a system that allows concurrent operation of multiple processes and locking of resources and which does not provide mechanisms to avoid or prevent deadlock must support a mechanism to detect deadlocks and an algorithm for recovering from them.

One such deadlock detection algorithm makes use of a wait-for graph to track which other processes a process is currently blocking on. In a wait-for graph, processes are represented as nodes, and an edge from process to implies is holding a resource that needs and thus is waiting for to release its lock on that resource. If the process is waiting for more than a single resource to become available (the trivial case), multiple edges may represent a conjunctive (and) or disjunctive (or) set of different resources or a certain number of equivalent resources from a collection. In the conjunctive case, graph cycles imply the possibility of a deadlock, whereas in the disjunctive case knots are indicative of deadlock possibility. There is no simple algorithm for detecting the possibility of deadlock in the final case. (Srinavasan, Rajaram 2011)

The wait-for-graph scheme is not applicable to a resource allocation system with multiple instances of each resource type.

References

  • Silberschatz, Abraham; Peter Galvin; Greg Gagne (2003). Operating System Concepts. John Wiley & Sons, INC. p. 260. ISBN 0-471-25060-0.