Skip to content
GATEiit

GATE CSE 2019 Q49: Condition guaranteeing only processes p and q can complete

Syllabus topic: Deadlock

Question

Consider the following snapshot of a system running n concurrent processes. Process i is holding Xi instances of a resource R, 1≤i≤n. Assume that all instances of R are currently in use. Further, for all i, process i can place a request for at most Yi additional instances of R while holding the Xi instances it already has. Of the n processes, there are exactly two processes p and q such that Yp=Yq=0. Which one of the following conditions guarantees that no other process apart from p and q can complete execution?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: A (official GATE 2019 final answer key)

Concept used: Since all instances are in use, only p and q (needing nothing more) can finish; the instances they release are the only free resources, so another process can finish only if its remaining need fits in Xp+Xq.

Concept notes

Loading notes…

First step: Let p and q finish and release Xp+Xq instances; ask what must hold so that even the process with the smallest further need Yk still cannot be satisfied.

Full step-by-step solution

Loading…

Answer from the official final answer key. Found a mistake? Use Report issue and we will fix it.

More questions on Deadlock

Every PYQ on this topic →

Share this question

WhatsAppDownload image

Source: official GATE 2019 CS question paper and final answer key, organised by IIT Madras. Question paper · Answer key