Skip to content
Official PYQ · 2006

GATE CS 2006 Q66 — Deadlock

Explain with AI

Consider the following snapshot of a system running nn processes. Process ii is  holding xix_i instances of a resource RR, 1≤i≤n1\leq i\leq n . Currently, all instances of RR are occupied. Further, for all ii, process ii has placed a request for an additional yiy_i instances while holding the xix_i instances it already has. There are exactly two processes pp and qq and such that yp=yq=0y_p=y_q=0. Which one of the following can serve as  a necessary condition to guarantee that the system is not approaching a deadlock?

Choose one option
View worked solution

Answer: B

To guarantee that the system is not approaching a deadlock, we must ensure that at least one process can eventually complete its execution and release its resources, allowing other processes to proceed.

Step-by-Step Analysis:

  1. Identify processes that can complete: We are given that exactly two processes, pp and qq, have no additional requests (yp=yq=0y_p = y_q = 0). Since they do not require any more resources, they can run to completion and release the resources they currently hold.
  2. Calculate available resources after completion: Process pp holds xpx_p instances and process qq holds xqx_q instances. Once both complete, they will release their resources, making a total of xp+xqx_p + x_q instances available to the system.
  3. Condition for further progress: For the system to avoid a deadlock, at least one of the remaining processes kk (where k≠p,qk \neq p, q) must be able to satisfy its request yky_k using these newly released resources.
    The minimum request among all remaining processes is: min⁡k≠p,qyk\min_{k \neq p, q} y_k If the total released resources xp+xqx_p + x_q is strictly less than this minimum request, then no remaining process can ever proceed, resulting in an unavoidable deadlock.

Therefore, a necessary condition to guarantee that the system can progress and avoid deadlock is:

xp+xq≥min⁡k≠p,qykx_p + x_q \geq \min_{k \neq p, q} y_k

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

Published
Report a correction
Keep exploringMore Deadlock questions