Question: [ Resource allocation graph - concurrency ] Deadlock can be defined as the permanent blocking of a set of processes that either compete for system

[Resource allocation graph- concurrency]
Deadlock can be defined as the permanent blocking of a set of processes that either compete for
system resources or communicate with each other. A set of processes is deadlocked when each
process in the set is blocked awaiting an event (typically the freeing up of some requested
resource) that can only be triggered by another blocked process in the set. Deadlock is permanent
because none of the events is ever triggered. Unlike other problems in concurrent process
management, there is no efficient solution in the general case.
In the code below, four processes (P0, P1, P2, P3) are competing for seven resources labelled A to
G. Each resource has a single instance, except resource E which has 2 instances.
Source: (Kishinkwa,2024)
2.1
a. Suppose the following codes are scheduled for execution line by line from PO to P3. Using a
resource allocation graph, show the possibility of a deadlock in this implementation.
(10 marks)
b. Modify the order of some of the get requests to prevent the possibility of any deadlock.
(5 Marks)
c. Is it possible that a resource deadlock involves multiple units of one type and a single unit of
another? If so, give an example.
(5 marks)
[ Resource allocation graph - concurrency ]

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 Finance Questions!