Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following resource-allotment strategy. Requests and releases for re

ID: 3626937 • Letter: C

Question

Consider the following resource-allotment strategy. Requests and releases for resources are permitted at any time. If a request for resources cannot be fulfilled because the resources are not available, then we check any processes that are blocked, waiting for resources. If they have the desired resources, then these resources are taken away from them and are given to the requesting process. The vector of resources for which the process is waiting is increased to include the resources that were taken away.
Assume a system with three resource types and the vector Available initialized to (5, 3, 3). If process P0 asks for (3, 3, 2), it gets them. If P1 asks for (1, 0, 1), it gets them. Then, if P0 asks for (0, 0, 1), it is blocked (resource not available). If P2 now asks for (2, 0, 0), it gets the available one (1, 0, 0) and one that was allocated to P0 (since P0 is blocked). P0’s Allocation vector goes down to (2, 3, 2) and its Need vector goes up to (1, 0, 1).
Answer the following questions:
a. Can indefinite blocking occur? Explain your answer.
b. Can deadlock occur? If you answer “yes”, give an example. If you answer “no,” specify which necessary condition cannot occur.

Explanation / Answer

a) An indefinite blocking can occur because a process may not acquire it needs if these resources are continuously preempted by other process. b) Deadlock cannot occur because preemption exists with P0.If a process is holding some resources and requests another resource that cannot be immediately allocated to it(that is,the process must wait),then all resources the process is currently holding are preempted.