Maximum claims and current allocations
The algorithm tracks total and available resources, current allocations and declared maximum demands. Remaining need is maximum minus allocation; multiple resource classes require componentwise comparisons rather than one summed count.
Dijkstra’s equivalent-unit model shows why a request within current supply can still leave every process needing more before returning its loan. Claim limits, immediate availability and the safety of the resulting state are separate checks.
Testing a hypothetical completion order
A safety check starts with available resources as its working supply and finds an unfinished process whose remaining need fits. It simulates that process completing and returning its allocation, adds the original allocation to working supply, and repeats until all can finish or no candidate remains.
Equality is allowed. With four units total, two maximum claims of three, allocations of two and one, and one unit free, the first process can finish and return resources so the second can finish too. This proves a feasible order without prescribing the only actual schedule.
Unsafe is not the same as already deadlocked
A request can be tested on a provisional state and committed only if that state remains safe; otherwise it waits. Unsafe means completion cannot be guaranteed against declared maxima, not that deadlock has already occurred, since actual future needs can be smaller.
The model needs usable maximum claims, compliant requests and eventual resource return after completion. Checking and conservative delays cost resources and concurrency. It is not a universal scheduler for arbitrary dynamic workloads or lock dependencies.