Skip to content
Related Articles

Related Articles

GATE | GATE CS 1996 | Question 70

View Discussion
Improve Article
Save Article
  • Last Updated : 16 Jul, 2021
View Discussion
Improve Article
Save Article

A computer system uses the Banker’s Algorithm to deal with deadlocks. Its current state is shown in the table below, where P0, P1, P2 are processes, and R0, R1, R2 are resources types.
alloc_tab

 

a) Show that the system can be in this state.
b) What will the system do on a request by process P0 for one unit of resource type R1?


Answer:

Explanation: (a) The current state of the system is possible because this can be part of one of the safe sequence. For example, following this state the system can follow P1->P2->P0 this sequence and will not lead to Deadlock, So, yes the system can be in this state.

(b) The system can allocate one unit of resource R1 to P0 and still will not lead to Deadlock, again it can still follow P1->P2->P0 sequence.

This is answered taken into consideration that the reader understands the Banker’s Algorithm.


Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!