Distinguishing deadlock avoidance from prevention
Deadlocks

Answer & solution
Official answer: A, C
Givens and goal
Select the false statements: A Banker’s algorithm is deadlock prevention; B disallowing hold-and-wait prevents deadlock; C an assignment edge in a resource-allocation graph goes from process to resource; D a safe state permits every process to finish without deadlock.
Approach
Distinguish the standard algorithm categories, recall graph edge direction, and interpret safety as existence of a safe completion sequence.
Step-by-step solution
1. Deadlock prevention structurally rules out at least one necessary condition, such as hold-and-wait. Avoidance instead examines potential grants and declines those that would leave the system unsafe.
2. Banker’s algorithm is an avoidance algorithm: it checks whether a safe completion sequence remains after a proposed allocation. Calling it prevention in the standard technical taxonomy is false, so select A.
3. If no process may hold resources while waiting for more, the hold-and-wait condition cannot hold. Since that condition is necessary for resource deadlock, B is true and must not be selected.
4. A request edge goes process→resource; an assignment edge goes resource-instance→process to indicate ownership. C reverses assignment direction, so select C.
5. A safe state means there is an order in which each process can obtain its remaining declared maximum need, finish, and release resources for later processes. That establishes D in the conventional safe-allocation sense.
6. Therefore the false statements are A and C. “Safe” asserts a feasible completion sequence under controlled allocation, not that arbitrary future grants can never make the system unsafe.




















![Question 66, GATE 2006: There are n processes; process i holds xᵢ instances of a resource and requests yᵢ additional instances. All resource instances are allocated. Exactly two processes p,q have yₚ=y_q=0. Which can be a necessary condition for avoiding impending deadlock? Max/min below range over k≠p,q. GFG prints max in B; GateForum prints min, a materially different condition.
Options:
(A) min(xₚ,x_q)<max yₖ
(B) xₚ+x_q≥max yₖ [GFG]; xₚ+x_q≥min yₖ [GateForum]
(C) max(xₚ,x_q)>1
(D) min(xₚ,x_q)>1](../../../assets/questions/CS-2006-Q66-1.webp)




![Question 1.21, GATE 2000: Processes P[0]…P[4] use mutexes m[0]…m[4]. Each waits on m[i], then m[(i+1) mod4], before releasing them. Can this cause thrashing, deadlock, starvation without deadlock, or none?](../../../assets/questions/CS-2000-Q21-1.webp)





















