5. (16 points) Consider deadlock avoidance with single resources. Assuming we have 4 process P1,P2, P3, P4. and 4 resources r1, r2, r3, r4. Consider all| 4 processes are writers (i.e. no resource scan be shared among processes). Suppose the processes are to acquire and release the release the resources in the following order (and assume the OS has the complete knowledge of the schedule beforehand) – we only show the first 8 requests.
We also assume the following:
if a request is denied, the process immediately quits and release all resources it is holding/waiting (if any).
if a process have to wait for a resource (if another process is holding it), the avoidance algorithm can still grant the request and allow that process to wait
all waiting queues for each resources are FIFO
a.Draw the resource allocation graph before the first request is made
b. Will the third request (P3 request r3) be granted? Explain your answer using the resource allocation graph.
c. Is there any request after that one that will be denied? If so, show the first request that will be denied and explain why using the resource allocation graph. If not, show the request allocation graph at the of the 8-th request.
Getting answers to your urgent problems is simple. Submit your query in the given box and get answers Instantly.