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