177
The banker’s algorithm
nWe also need the amount allocated A(j,i) of resource type i to process j for all (j,i)
nThe total amount available of resource i is given by: V(i) = R(i) - S_k A(k,i)
nWe also use the need N(j,i) of resource type i required by process j to complete its task: N(j,i) = C(j,i) - A(j,i)
nTo decide if a resource request made by a process should be granted, the banker’s algorithm test if granting the request will lead to a safe state:
uIf the resulting state is safe then grant request
uElse do not grant the request