OPERATING SYSTEMS Deadlocks PLEASE SHOW YOUR WORK IM TRYING

OPERATING SYSTEMS: Deadlocks

PLEASE SHOW YOUR WORK! I\'M TRYING TO UNDERSTAND HOW TO ACTUALLY DO THE PROBLEM.

7. [2] Does the following resource allocation result in a deadlock? Can we eliminate the deadlock if the resource assignment 1 can be cancelled (explain)? Can we eliminate the deadlock if the process 1 can be killed (explain)?

[1] Does the following resource allocation graph cause deadlocks? If not, explain the possible sequence of releasing the cycle.

Solution

7[2]

Yes, there is deadlock . P1 is waiting for resource which is held by P2,P2 is waitinf gor resource held by P3 and P3 is waiting for resource instances held by P1 and P2. No process is able to complete and there is cycle in the graph which indicates a deadlock state.

Yes, we can eliminate the deadlock if the resource assignment 1 can be cancelled. Now P2 has enough resources to complete its tasks. Then P1 can get both the resources to finish its task.After P1 finishes P3 can get the resource to exceute. All the processes will successfully execute.

If process P1 is killed, P3 will get two resources to get execute. After P3 finishes it release the resource for P2 so that P2 gets three resources required for its execution.So we can eliminate the deadlock by killing process P1.

[1]

The resource allocation graph will not cause deadlock. Process P2 and P4 requires one resource each which they are holding . So they will successfully execute and release the resources. The resource released by P2 can be used by P1, so P1 finishes execution. Resource released by P4 can be used by P3 to execute successfully. So there is no deadlock.

There is cycle but there are more than one instances of resources. So there is no deadlock

Possible Sequence of reaeasing the cycle:

OPERATING SYSTEMS: Deadlocks PLEASE SHOW YOUR WORK! I\'M TRYING TO UNDERSTAND HOW TO ACTUALLY DO THE PROBLEM. 7. [2] Does the following resource allocation resu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site