Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi Can I get help with this problem, please? (Operating System) A system compose

ID: 3600851 • Letter: H

Question

Hi

Can I get help with this problem, please?

(Operating System)

A system composed of four processes, {P1, P2, P3, P4}, and three types of reusable resources, {R1, R2, R3}. The number of units of the resources are C=<3, 2, 2> respectfully. Current process states are as follows:

• Process P1 holds one unit of R1 and requests one unit of R2.

• Process P2 holds two unit of R2 and requests one unit of each of R1 and R3.

• Process P3 holds one unit of R1 and requests one unit of R2.

• Process P4 holds two unit of R3 and requests one unit of R1.

Q. Is this system in deadlocked? Why/Why not?

Explanation / Answer

Given,
P1 holding 1-R1
P2 holding 2-R2
P3 holding 1-R1
P4 holding 2-R3
From the above data, only 1 instance of R1 is free.
P1 requesting R2, has to wait untill P2 releases R2.
P2 is requesting one instance of R1 and R3 and one intance of R1 is available and is allocated to P2 and P2 will not release R2 untill it is allocated with R3.
R3 is being used by P4 and P4 will not release R3 unless it is allocated with R1 which is already using by P2 and P3. And P3 will nor release R1 as it is waiting for R2.
From the above P1 is waiting for P2 and P2 is waiting for P4 and P4 is waiting for P3 and P3 is waiting for P2 and loop occurs (P2 -> P4 -> P3 -> P2) there by leading to a DEADLOCK.