Question

Consider the following snapshot of a system running nn concurrent processes. Process ii is holding XiX_i instances of a resource RR, 1≤i≤n1 \le i \le n. Assume that all instances of RR are currently in use. Further, for all ii, process ii can place a request for at most YiY_i additional instances of RR while holding the XiX_i instances it already has. Of the nn processes, there are exactly two processes pp and qq such that Yp=Yq=0Y_p = Y_q = 0. Which one of the following conditions guarantees that no other process apart from pp and qq can complete execution?

Choose one option
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 RR are in use, so the number of available instances is 00.

Processes pp and qq have additional requests Yp=Yq=0Y_p = Y_q = 0. Since they require 00 additional instances, both pp and qq can immediately finish execution without needing any further allocation.

When pp and qq complete execution, they release the instances they were holding, which are XpX_p and XqX_q respectively.
Therefore, the total number of newly available instances of RR in the system is:

Available=Xp+Xq\text{Available} = X_p + X_q

For any remaining process k∉{p,q}k \notin \{p, q\} to be able to execute, its additional request YkY_k must be less than or equal to the available instances.
If the total available instances Xp+XqX_p + X_q is strictly less than the minimum additional demand among all other processes:

Xp+Xq<Min{Yk∣1≤k≤n,k≠p,k≠q}X_p + X_q < \text{Min}\{Y_k \mid 1 \le k \le n, k \ne p, k \ne q\}

Then no remaining process can have its request satisfied. Every remaining process will be permanently blocked, guaranteeing that no process other than pp and qq can complete execution (Option A).

Final answer

A

Common trap

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.