-
A single processor system has three resources types X, Y and Z, which are shared by three processes. There are 5 units of each resources 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?
-
- P0
- P1
- P2
- None of the above, since the system is in a deadlock
- P0
Correct Option: C
From the given matrix we found that the number of available resources of X, Y and Z types are 0, 1, 2 respectively. Therefore, P1 will avail these resources first and after release the resources available will be (2, 1, 3) which will be used by P0 as its request is of 1, 0, 3 resources. After P0 releases the resources, the availability becomes (3, 3, 4) and P2 will use these resources then as per its requirements. Thus, P2 finishes in the last.