Last Updated :
06 Dec, 2018
Consider the following system there are total 12 instances of resources A, 10 instances of resources B and 11 instances of resources C:
Process Allocation Maximum
A B C A B C
P0 0 2 3 3 3 6
P1 2 4 2 2 5 3
P2 3 1 2 3 5 3
P3 5 2 2 6 5 4
If Banker\’s algorithm is aaplied for dealdlock avoidence this sytem is in safe state. Which of the following option will not be permitted with additional request?
(A) Request: P3 – 1 instance of A, 2 instances of B, 3 instances of C
(B) Request: P2 – 1 instance of A, 2 instances of B, 3 instances if C
(C) Request: P1 – 1 instance of A, instances of B, 3 instances of C
(D) Request: P0 – 1 instance of A, 2 instances of B, instances of C
Answer: (C)
Explanation: Currently, the system is in the safe state. When addition requests are made:
Available Instances are
A B C
2 1 2
Request: P3 – 1 instance of A, 2 instances of B, 3 instances of C
Need matrix:
A B C
3 3 6
0 1 1
0 4 1
2 5 5
Since 2 instances of A, 1 instance of B, 2 instances of C.
System is in safe state and start processing from P1.
Since 2 instances of A, 1 instance of B, 2 instances of C.
System is in safe state and start processing from P1.
Request: P1 – 1 instance of A, 2 instances of B, 3 instances of C
Need matrix:
A B C
2 1 3
1 3 4
0 4 1
1 3 2
The system is unsafe. Since 2 instances of A, 1 instance of B, 2 instances of C.
Request: P2 – 1 instance of A, 2 instances of B, 3 instances of C
Need matrix:
A B C
3 3 6
0 1 1
1 6 4
1 3 2
System is in safe state and start processing from P1.
Since 2 instances of A, 1 instance of B, 2 instances of C.
Request: P0 – 1 instance of A, 2 instances of B, 3 instances of C
Need matrix:
A B C
3 3 6
0 1 1
0 4 1
1 3 2
So, option (C) is correct.
Quiz of this Question
Share your thoughts in the comments
Please Login to comment...