Circular wait

From Wikipedia, the free encyclopedia

In computer science circular wait is one of the four conditions necessary for deadlock to occur. Circular wait is defined as situation where there exists a circular chain of processes, each waiting for a resource held by next process in the chain.

Circular wait prevention consists in allowing processes to wait for resources, but ensure that the waiting can't be circular. One approach might be to assign a precedence to each resource and force processes to allocated resources in order of increasing precedence. That is to say that if a process holds some resources, and the highest precedence of these resources is m, then this process cannot request any resource with precedence smaller than m. This forces resource allocation to follow a particular and non-circular ordering, so circular wait cannot occur. Another approach is to allow holding only one resource per process; if a process requests another resource, it must first free the one it's currently holding (or hold-and-wait).

[edit] See also