(Banker’s algorithm)

Consider the following situation concerning processes and resources assigned to

them: There are three processes p1, p2, p3, and four types of resources R1, R2,

R3, R4. The existence vector for the resources is E = (5, 5, 5, 5). The claim

matrix is as follows:

R1 R2 R3 R4

p1 5 3 0 4

p2 4 2 3 0

p3 4 2 2 1

The current situation for each process is:

• p1 holds 4 units of R1, 2 units of R2, 3 units of R4.

• p2 holds 3 units of R3.

• p3 holds 2 units of R2.

For the described situation, answer the following questions:

(a) Compute the request matrix and the availability vector.

[5 marks]

(b) Suppose that p2 requests 1 unit of R2 and that this request is granted.

Use the Banker’s algorithm to determine if the resulting state is a safe

state or not. Show each step of the algorithm.

[10 marks]

Subtotal: [15 marks]