nREPEAT: Find a unfinished process j such that N(j,i) <=
W(i) for all i.
uIf
no such j exists, goto EXIT
uElse: “finish” this process and recover its resources: W(i) =
W(i) + A(j,i) for all i. Then goto REPEAT
nEXIT: If all processes have “finished” then this state is
safe. Else it is unsafe.