Similar questions 7 more →
Deadlocks

Answer & solution
Official answer: 2
Method
If every unfinished process has fewer than its maximum requirement, each may hold at most K−1 while waiting for another instance. With K=2, three such waiting processes can hold at most three resources, leaving the fourth available to let one finish. Releasing its resources then enables the others. For K=3, a feasible allocation (2,1,1) consumes all resources while each process can still request one; no request can be granted. This supplies both safety and a tight counterexample.
Solution
For n=3 processes each requiring at most K identical resources, a sufficient and tight universal bound is R≥n(K−1)+1: for K=2, any allocation in which all three processes still need another instance leaves at least one of the four resources free; for K=3 the allocation (2,1,1) can instead exhaust all resources with all processes waiting. With R=4, K=2 satisfies 4≥4, while K=3 permits holdings2, 1, 1 and all waiting. Thus the largest guaranteed-safe K is 2, assuming completed processes release their resources.