Question: Question 4 (Total: 14 marks) Two processes P and Q execute in a uniprocessor system and share the resources R1, R2 and R3. Assume that

Question 4 (Total: 14 marks) Two processes P and

Question 4 (Total: 14 marks) Two processes P and Q execute in a uniprocessor system and share the resources R1, R2 and R3. Assume that the processes need to have exclusive control on the resources. The execution steps of P and Q are shown below: Process P Process Q Get R1 Get R3 Get R2 Get R2 Release R1 Release R2 Get R3 Get R1 Release R2 Release R3 Release R3 Release R1 . (a) Draw the Joint Progress Diagram for Process P and Process Q. Put Process P at the horizontal axis, and Process Q at the vertical axis. In the diagram, clearly show the following: The regions where both processes want a resource The deadlock inevitable (fatal) region One progress path that results in deadlock One progress path that does not result in deadlock (if any) (8 marks) . (b) Suggest a change to the steps of Process P so that deadlock does not happen. (2 marks) (c) Consider the progress path that results in deadlock in your answers from part (a). Draw the resource allocation graph of the deadlock scenario. (4 marks) Question 4 (Total: 14 marks) Two processes P and Q execute in a uniprocessor system and share the resources R1, R2 and R3. Assume that the processes need to have exclusive control on the resources. The execution steps of P and Q are shown below: Process P Process Q Get R1 Get R3 Get R2 Get R2 Release R1 Release R2 Get R3 Get R1 Release R2 Release R3 Release R3 Release R1 . (a) Draw the Joint Progress Diagram for Process P and Process Q. Put Process P at the horizontal axis, and Process Q at the vertical axis. In the diagram, clearly show the following: The regions where both processes want a resource The deadlock inevitable (fatal) region One progress path that results in deadlock One progress path that does not result in deadlock (if any) (8 marks) . (b) Suggest a change to the steps of Process P so that deadlock does not happen. (2 marks) (c) Consider the progress path that results in deadlock in your answers from part (a). Draw the resource allocation graph of the deadlock scenario. (4 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!