GATE - 2007 | OS | A single processor system has three resource types X, Y, and Z, which

GATE - 2007 | OS | A single processor system has three resource types X, Y, and Z, which
Posted on 16-02-2022

GATE - 2007 [Operating System]

Question:

A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Which of these processes will finish LAST?

 

    alloc           request

    X Y Z            X Y Z

P0  1 2 1            1 0 3

P1  2 0 1            0 1 2

P2  2 2 1            1 2 0

 

A

P0

B

P1

C

P2

D

None of the above, since the system is in a deadlock.

    

Solution:

Option (C) is Correct.

Given that there are 5 units of each resource type.


A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Which of these processes will finish LAST?

543:


System is in safe state


Order of Execution = p1, p0, p2

P2 will execute last.