Skip to content
Official PYQ · 2019

GATE CS 2019 Q39 — Deadlock

Explain with AI

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 \leq i \leq 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
View worked solution

Answer: A

To find the condition that guarantees no process other than pp and qq can complete, we analyze the resource allocation state step-by-step:

  1. Initial State: All instances of resource RR are currently in use, which means the number of currently free/available instances of RR is 00.
  2. Execution of pp and qq: We are given that Yp=Yq=0Y_p = Y_q = 0. This means processes pp and qq require 00 additional resources to complete. Since they need no additional resources, they can execute to completion and release the resources they currently hold (XpX_p and XqX_q respectively).
  3. Available Resources after pp and qq finish: Once pp and qq complete, the total available resources in the system will be: Available=Xp+Xq\text{Available} = X_p + X_q
  4. Condition for other processes to complete: For any other process kk (where k≠pk \neq p and k≠qk \neq q) to complete, the system must be able to satisfy its maximum additional request YkY_k.
    If the total available resources Xp+XqX_p + X_q is strictly less than the minimum additional requirement of all other processes, then no remaining process can ever satisfy its request: Xp+Xq<Min{Yk∣1≤k≤n,k≠p,k≠q}X_p + X_q < \text{Min} \{Y_k \mid 1 \leq k \leq n, k \neq p, k \neq q \} Under this condition, even the process with the smallest additional requirement cannot be satisfied, ensuring that no other process can complete execution.

Thus, Option A is the correct condition.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Deadlock questions