Safety algorithm - bool safe(state);
CurrentAvail = Available;
Rest = {set of all processes};
while (Possible)
- Find Pk in Rest such that Claim[k,*] - Allocation[k,*] < CurrentAvail;
- if found,
{ CurrentAvail = CurrentAvail + Allocation[k,*];
Rest = Rest - {Pk};}
- else Possible = False;
/* ASSERT: either Rest is empty or Allocation failed */