wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

In a system, there are three types of resources: E, F and G. Four processes P0,P1,P2 and P3 execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example Max[P2.F] is the maximum number of instances of F that P2 would require. The number of instances of the resources allocated to the various processes at any given state is given by a matri named Allocation.
Consider a state of the system with the Allocation matrix as shown below and in which 3 instances of E and 3 of F are the only resources available.

Allocation
E F G
P0 1 0 1
P1 1 1 2
P2 1 0 3
P3 2 0 0
Max
E F G
P0 4 3 1
P1 2 1 4
P2 1 3 3
P3 5 4 1

From the perspecitve of deadlock avoidance, which one of the following is true?

A
The system is in safe state.
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
The system is not in safe state, but would be safe if one more instance of E were available.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
The system is not in safe state, but would be safe if one more instance of G were available.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
The system is not in safe state, but would be safe if one more instance of F were available.
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A The system is in safe state.
Max Need Current allocation Current available Remaing need
E F G E F G E(3) F(3) G(3) E F G
P0 4 3 1 1 0 1 4 3 1 3 3 0
P1 2 1 4 1 1 2 5 3 4 1 0 2
P2 1 3 3 1 0 3 6 4 6 0 3 0
P3 5 4 1 2 0 0 8 4 6 3 4 1


Safe sequence :P0,P2,P1,P3
Hence, system is in safe state.

flag
Suggest Corrections
thumbs-up
1
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Banker's Algorithm
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon