The bucket starts nearly empty (Work=Available). Each time a process passes Requesti≤Work, it finishes and pours its Allocationi into the bucket, so the level rises. As the level rises, requests that were "too big" a moment ago now fit — that is the snowball. If at some point no remaining process's request fits the current level and the level stops rising, those leftover processes can never be satisfied → they are the deadlocked set (shown in coral at the bottom of the figure).
A cycle in the Wait-For Graph always means deadlock.
Only in a single-instance system. With multiple instances per type another holder may release an instance that frees a waiter, so the cycle can dissolve without simulation confirming it (see the finish-snowball figure s02).
If the detection loop finishes with every Finish[i]=true, the system is deadlock-free right now.
True — a valid finish order exists, so every process can obtain its current Requesti, run, and release; nobody is permanently stuck.
Deadlock detection guarantees no process will ever deadlock in the future.
False. Detection is a snapshot of the current state; it says nothing about requests that arrive later. See Deadlock Prevention vs Avoidance — only avoidance/prevention look forward.
A process holding zero resources can still be part of a deadlock.
False. With Allocationi=0 it starts Finish=true: it holds nothing anyone waits for, so it cannot sit in a circular-wait chain.
Running detection more often is strictly better because you catch deadlocks sooner.
False. Detection costs O(m⋅n2) (justified in the Why section); running it on every ungrantable request is huge overhead. Rareness of deadlock is exactly why we tolerate delay.
Aborting all deadlocked processes is the safest recovery because it definitely works.
It definitely breaks the deadlock, but "safest" is wrong — it discards the most work. Abort-one-at-a-time wastes less but reruns the detector repeatedly.
The detection algorithm and Banker's safety check are the same algorithm.
False. The loop shape matches, but detection tests actual current Requesti (backward-looking) while Banker's tests Needi=Maxi−Allocationi (worst-case, forward-looking).
Preempting a resource always requires a rollback.
Essentially true: the victim lost a resource mid-use, so it must roll back to a safe checkpoint (or restart) to stay consistent — you can't just continue as if nothing happened.
If deadlock detection reports "no deadlock", CPU utilization must be high.
False. Utilization can be low for many reasons (I/O waits, idle jobs). Low utilization is only a trigger to consider running detection, not a synonym for deadlock.
"With multiple instances, we detect deadlock by finding a cycle in the Wait-For Graph."
Error: WFG cycles only decide single-instance systems. Multiple instances require the finish-simulation, because a cycle there is necessary but not sufficient.
"In detection we use Needi=Maxi−Allocationi to see who can finish."
Error: that's Banker's, which uses the worst-case leftover need. Detection uses the actual currentRequesti, not any maximum.
"Requesti≤Work means process i finished, so add Work to Allocationi."
Two errors: it means ican finish (not that it did), and we add Allocationi to Work (reclaim what it holds), not the other way round.
"Since all four Coffman conditions must hold, breaking mutual exclusion is the standard recovery."
Error: the four conditions are mutual exclusion (a resource can't be shared), hold-and-wait, no-preemption, and circular-wait — and mutual exclusion is usually intrinsic (a printer can't be shared), so recovery normally breaks no-preemption (preempt) or circular-wait (abort) instead. See Coffman Conditions.
"Victim selection just picks the process with the fewest resources so cleanup is fast."
Oversimplified/wrong. Cost blends priority, time already run, resources held, processes affected, and — crucially — number of prior rollbacks to prevent starvation.
"The detector tells us exactly which request caused the deadlock."
Error: if detection runs periodically rather than on every request, many requests happened since the deadlock formed, so you generally can't pinpoint the culprit request.
"A safe state and a deadlock-free snapshot are the same thing."
Error: safe (Banker's) means a safe sequence exists for all future worst-case demands (Needi); deadlock-free detection only means the currentRequesti can all be satisfied. Safe ⊂ deadlock-free.
Why does a zero request always pass the Requesti≤Work test?
Because the ≤ is component-wise (defined above): (0,0,…)≤Work holds for any non-negative Work since every entry 0≤Work[k]. A process asking for nothing needs nothing granted, so it finishes immediately and releases its holdings. Example with m=3: P0 with Request=(0,0,0) passes even when Work=(0,0,0).
Why do we optimistically grant to whoever can run instead of proving deadlock directly?
Toy example with m=3 types: pool starts empty (0,0,0), but P0 holds (0,1,0) and requests nothing. Grant P0 → it finishes → Work grows to (0,1,0). Now a process that needed that one unit of the second type can run, hands its stuff back, and the pool snowballs. Anyone still unsatisfiable after the pool stops growing is genuinely, permanently stuck — that's your deadlock set. (See figure s02.)
Why include the number of rollbacks in a victim's cost function?
To prevent starvation. Imagine the cost picks the cheapest victim; if process X is always cheapest, it gets preempted, rolled back, preempted, rolled back… forever and never finishes. Adding "how many times has X already been rolled back?" makes X grow expensive, so eventually someone else is chosen and X can complete.
Why does the single-instance case cost O(n2) while multiple instances cost O(m⋅n2)?
Single instance = plain cycle detection on the Wait-For Graph, whose nodes are the n processes; DFS visits each node and edge, and with up to n nodes and up to n2 possible edges that is O(n2) (here n = number of processes, same n used everywhere on this page). Multiple instances: each pass of the finish-loop scans all n processes, and for each one compares m resource components in Requesti≤Work — that's m⋅n work per pass. In the worst case only one new process finishes per pass, so you need up to n passes → m⋅n×n=O(m⋅n2).
Why is "detect and recover" chosen over prevention when deadlocks are rare?
Prevention/avoidance runs a check on every single resource request — a permanent tax paid millions of times a second. Detect-and-recover pays nothing per request and only runs the expensive detector occasionally (e.g. when CPU utilization dips). If deadlocks almost never happen, the occasional big bill is far cheaper than the constant small one.
Why can't preemption recovery skip the rollback and just resume the victim later?
Walk it through: process X was halfway through writing a file using resource R when R was snatched. X's internal state (variables, half-written data) assumes it still holds R and its work is intact. If you just hand R back and resume, X continues from corrupt state. Instead it must return to a consistent checkpoint taken before R was in use, and redo from there.
Detection still works: Work begins at (0,0,…), so only processes with a zero Request (or ones satisfied once a finisher reclaims resources) can start. The whole snowball bootstraps from reclaimed Allocation, not from free instances.
What if every process holds resources but every Requesti is zero?
No deadlock — each process needs nothing more, so all pass the test immediately and finish; there's no circular wait to trap them.
Can a WFG cycle appear yet the snapshot be deadlock-free?
Yes — but only with multiple instances. The snowball may let a third holder finish and release an instance that satisfies one process in the loop, breaking the "cycle". This is exactly why single-instance WFG cycles are sufficient but multi-instance ones are not: the graph loses information about spare copies.
A single process requests more of a resource than the system will ever have — deadlock?
No, that's not deadlock (no set of mutually-waiting processes); it's an unsatisfiable request / error. Deadlock needs circular waiting among a set of two or more.
Detection runs, finds nobody can finish, but one process was about to voluntarily release — is it really deadlocked?
By the snapshot it is deadlocked. Detection judges the frozen state; a release that hasn't happened yet isn't visible, which is a limitation of snapshot-based detection, not a false positive of the rule.
Only three of the four Coffman conditions hold — can deadlock occur?
No. All four (mutual exclusion, hold-and-wait, no-preemption, circular-wait) are necessary; break any one and deadlock is impossible — which is exactly how recovery works.
Recall One-line self-test
The two verdict rules ::: Single instance: cycle in WFG is necessary AND sufficient. Multiple instances: run the finish-simulation; leftover Finish[i]=false processes are deadlocked.
The two recovery families ::: Process termination (abort all / abort one-by-one, rerunning the detector) and resource preemption (pick victim → rollback to a checkpoint → count rollbacks to avoid starvation).