Jobs in Pakistan

CS604 Assignment 3 Spring Solution 2021 Download Solution File

 CS604 Assignment 3 Solution Spring 2021

CS604 Assignment 3 Spring Solution 2021 Download Solution File


Q1. Suppose a system depicts the following state of currently running processes with a 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 instance of resource type R2
  • One instance of resource type R3
  • One instance 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.

A. You are required to draw the Resource Allocation Graph and state that either system is in a safe state or not. Briefly justify your answer.


CS604 Assignment 3 Spring Solution 2021 Download Solution File


The system is not a 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

Allocate

R1

R2

R3

R4

P1

1

0

0

0

P2

0

0

1

0

P3

0

0

0

1

P4

0

0

1

0


No comments:

Post a Comment

Verification: 5454749714e96868