|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n |
We also need
the amount allocated A(j,i) of
|
|
|
|
resource type
i to process j for all (j,i)
|
|
|
n |
The total
amount available of resource i is
|
|
|
given by: V(i)
= R(i) - S_k A(k,i)
|
|
|
n |
We 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)
|
|
|
n |
To 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:
|
|
|
|
u |
If the resulting
state is safe then grant request
|
|
|
|
u |
Else do not grant
the request
|
|