CS604 Assignment No. 3 Fall 2021 100% Correct Complete Solution By Mustakbil Corner
For solution please
It is requested to you to please subscribe our Blog for latest updates
STEP 1 : Subscribe
STEP 2
| Operating System (CS604) Assignment # 03 | |
|
Q1.
Suppose a system depicts the following state of
currently running processes with number of
resources types’ instance.
· P= { P1,P2,P3,P4 }
· R = { R1, R2, R3, R4 }
· E ={P1 ->R1, P2 ->R3,P3->R4, P4->R3, R1-> P2,R2->P1, R2->P2, R3->P3, R4->P4 }
Resource Instances
· One instance of resource type R1
· Two instances of resource type R2
· One instance of resource type R3
· One instances of resource type R4
Process States
· Process P1 is holding an instance of resource R2, and is waiting for an instance of resource R1.
· Process P2 is holding an instance of resource R1 and R2, and is waiting for an instance of resource R3.
· Process P3 is holding an instance of resource R3 and waiting for an instance of resource R4.
· Process P4 is holding an instance of resource R4 and waiting for resource R3.
Considering the above system state
A. You are required to draw the Resource Allocation Graph and state that either system is in safe state or not. Briefly justify your answer
P1 |
P2 |
P4 |
P3 |
R2 |
R4 |
R1 |
R3 |
Holding |
Holding |
Holding |
Waiting |
Waiting |
Waiting |
Waiting |
Holding |
Holding |
The system is not in safe state as it is in deadlock because the system cannot fulfill
The request of all the processes then the state of the system .
B. Draw the Allocation Matrix from given process states.
Process | Allocate | |||
R1 | R2 | R3 | R4 | |
P1 | 0 | 1 | 0 | 0 |
P2 | 1 | 1 | 0 | 0 |
P3 | 0 | 0 | 1 | 0 |
P4 | 0 | 0 | 0 | 1 |
C. Draw the Need Matrix from given process states.
Process | Request | |||
R1 | R2 | R3 | R4 | |
P1 | 1 | 0 | 0 | 0 |
P2 | 0 | 0 | 1 | 0 |
P3 | 0 | 0 | 0 | 1 |
P4 | 0 | 0 | 1 | 0 |
0 Comments
If you have any queries please drop in your comments.