GATE CSE 2018 Q49: Banker's algorithm safety check for four processes and resources E, F, G
- Operating System
- 2 marks
- MCQ
- −2/3 if wrong
Syllabus topic: Deadlock
Question
In a system, there are three types of resources: , and . Four processes , , and execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example, Max is the maximum number of instances of that would require. The number of instances of the resources allocated to the various processes at any given state is given by a matrix named Allocation.
Consider a state of the system with the Allocation matrix as shown below, and in which 3 instances of and 3 instances of are the only resources available.
| E | F | G | |
|---|---|---|---|
| 1 | 0 | 1 | |
| 1 | 1 | 2 | |
| 1 | 0 | 3 | |
| 2 | 0 | 0 |
| E | F | G | |
|---|---|---|---|
| 4 | 3 | 1 | |
| 2 | 1 | 4 | |
| 1 | 3 | 3 | |
| 5 | 4 | 1 |
From the perspective of deadlock avoidance, which one of the following is true?
Try it: multiple choice: exactly one correct option
Show answer and explanation
Answer: A (official GATE 2018 final answer key)
Concept used: Banker's safety algorithm: a state is safe if some order lets every process obtain its remaining need (Max − Allocation) from the available pool and then release its allocation.
First step: Compute Need = Max − Allocation for each process and look for one whose need fits in Available = (3, 3, 0).
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
Source: official GATE 2018 CS question paper and final answer key, organised by IIT Guwahati. Question paper · Answer key
More Operating System PYQs
- 2026 Session 1 · Q29False statements about deadlocks
- 2026 Session 1 · Q35Minimum resource instances for deadlock freedom (5 processes, max 2)
- 2026 Session 1 · Q59Disk transfer time for random sectors on tracks 5, 12, 7
- 2026 Session 1 · Q63Number of printf calls with fork, continue and break
- 2026 Session 1 · Q64Average FCFS waiting time for alternating A and C processes
- 2026 Session 2 · Q23CPU scheduling algorithm that cannot be preemptive