Question
Consider the following snapshot of a system running concurrent processes. Process is holding instances of a resource , . Assume that all instances of are currently in use. Further, for all , process can place a request for at most additional instances of while holding the instances it already has. Of the processes, there are exactly two processes and such that . Which one of the following conditions guarantees that no other process apart from and can complete execution?
Official answer and solution
- Official answer
- A
- From
- Official GATE 2019 answer key
Solution
Determine the resource availability threshold after processes p and q finish that prevents any other process from satisfying its maximum claim.
We are given that initially all instances of resource are in use, so the number of available instances is .
Processes and have additional requests . Since they require additional instances, both and can immediately finish execution without needing any further allocation.
When and complete execution, they release the instances they were holding, which are and respectively.
Therefore, the total number of newly available instances of in the system is:
For any remaining process to be able to execute, its additional request must be less than or equal to the available instances.
If the total available instances is strictly less than the minimum additional demand among all other processes:
Then no remaining process can have its request satisfied. Every remaining process will be permanently blocked, guaranteeing that no process other than and can complete execution (Option A).
A
Choosing Max instead of Min (if X_p + X_q < Max, some process with smaller Y_k could still run).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2019 Computer Science and Information Technology (CS)
- Question
- 49 of 65, printed as CS Q.39
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.