GATE / CS ARCHIVE

GATE CSE 2019 / QUESTION 39

Resources required before another completion

Operating Systems · Deadlocks · Full GATE CSE 2019 paper

GATE 2019, Q39 2 marks · MCQ
Report issue

Deadlocks

Question 39, GATE 2019: All instances of resource R are allocated. Process i holds Xi and may request at most Yi additional instances. Exactly p and q have Yp=Yq=0. Which condition guarantees no other process completes? A Xp+Xq<min other Yk; B Xp+Xq<max other Yk; C min(Xp,Xq)≥min other Yk; D min(Xp,Xq)≤max other Yk.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A under actual-remaining-demand interpretation

1. First solve the intended resource-demand model, where Yi is the amount process i still needs in order to finish. Because no resource instances are currently free, only p and q have enough resources to finish immediately.
2. Once both finish and release what they hold, the total available pool is A=Xp+Xq. No other process has released anything yet.
3. If A<min{Yk:k≠p,q}, then A is smaller than every remaining demand. There is no possible next finishing process, so the system cannot enlarge its free pool by further completions. This yields option A under that model.
4. Comparing A with the maximum demand, as in B, blocks only at least one large-demand process; a smaller-demand process may finish and release resources. C and D similarly do not establish insufficiency for every remaining process.
5. The literal wording is weaker: each Yi is an upper bound on additional requests, not a necessary demand. A process with positive Yi could actually need zero more instances and finish. For example, with Xp=Xq=1 and another process's bound Yk=3, A holds, yet that process may finish without requesting anything.
6. Thus the keyed A needs the actual-remaining-demand interpretation. Under upper bounds alone, the claimed guarantee is not justified. Preserve this model caveat rather than presenting A as unconditional.

Original paper, page 13 · Answer key