GATE CS 2014 Set 1 — Question 41
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MCQ+2 / -0.67MediumBanker's AlgorithmDeadlocksOperating SystemDeadlock Numericals
Operating System → Deadlocks → Banker's Algorithm
Last updated
Question
An operating system uses the Banker’s algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.
There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state. Consider the following independent requests for additional resources in the current state:REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of ZWhich one of the following is TRUE?
| Allocation | Max | |||||
|---|---|---|---|---|---|---|
| X | Y | Z | X | Y | Z | |
| P0 | 0 | 0 | 1 | 8 | 4 | 3 |
| P1 | 3 | 2 | 0 | 6 | 2 | 0 |
| P2 | 2 | 1 | 1 | 3 | 3 | 3 |
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of ZWhich one of the following is TRUE?
Correct answer
(B) Only REQ2 can be permitted.
Solution
We are given the Available vector: .Step 1: Calculate Need Matrix
Step 2: Check REQ1 for P0: (0, 0, 2)
Initial Available:
Step 2: Check REQ1 for P0: (0, 0, 2)
1.Request Available? True.
2.Request Need? True.
3.Pretend Allocation:
- Available becomes
- P0 Allocation becomes
- P0 Need becomes
- Can P1 finish? Need . Yes. New Avail = .
- Can P2 finish? Need . Yes. New Avail = .
- Can P0 finish? Need . Yes.
Initial Available:
1.Request Available? True.
2.Request Need? True.
3.Pretend Allocation:
- Available becomes
- P1 Allocation becomes
- P1 Need becomes
- Can P1 finish? Need . Yes. New Avail = .
- Can P2 finish? Need . Yes. New Avail = .
- Can P0 finish? Need . Yes.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Deadlocks
2026 Set 2 Q23Which one of the following CPU scheduling algorithms cannot be preemptive?2026 Set 1 Q29With respect to deadlocks in an operating system, which of the following statements is/are FALSE?2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 1 Q35Consider a system consisting of instances of a resource , being shared by 5 processes.…2026 Set 2 Q51Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A…