operating-systems concurrency

Definition

Circular Wait

Circular wait is a condition in which there exists a closed chain of processes such that each process holds at least one resource needed by the next process in the chain.

Formally, for processes : holds resource and requests .

Prevention

Strict Linear Ordering

Impose a strict linear ordering on all resource types. Each process must request resources in increasing order of the ordering.

Circular Wait Prevention

Assume a circular wait exists under strict linear ordering of resource types. Let the cycle be

Since each process requests a resource with higher order than the one it currently holds:

This is a contradiction. Therefore, no circular wait can occur.