Question: Consider a system employing a deadlock - avoidance scheme based on pre - declaration of resource needs for various processes. In particular, the resource needs
Consider a system employing a deadlockavoidance scheme based on predeclaration of resource needs for various processes. In particular, the resource needs of the processes are represented by claim arcs in the resourceallocation graph. Whenever a resource request by a process is issued, it is rejected by the system if the newly formed allocation arc from the resource vertex to the process vertex replacing the corresponding claim arc from the process vertex to the resource vertex closes a cycle in the resourceallocation graph. Otherwise, the system grants the request and converts the claim arc to the allocation arc in the resourceallocation graph.
Let P P and P be three processes in the system. Let P declare that it may request resources W X and Y; P declare that it may request resources X Y and Z; P declare that it may request resources W Y and Z Construct the resourceallocation graph with the appropriate claim arcs.
Consider each of the following pairs of resource requests. Based on the resourceallocation graph constructed above, identify the pair of requests among the following that can be granted without a deadlock possibility?
a P requesting W and P requesting Y
b P requesting X and P requesting Z
c P requesting Z and P requesting Y
d P requesting Y and P requesting Z
Let a system allocate resources to processes as long as the system state remains safe with respect to deadlocks. Note that a system state is safe if there is a way to allocate the remaining resources in such a manner as to satisfy the maximum needs of all the processes.
With respect to a resource R let the system have instances of the resource and let there be five processes P P P P and P that have maximum needs of and instances of the resource respectively.
Start with a safe state in which P is holding no instances, P P and P are holding two instances each and P is holding one instance of R Now, consider each of the following requests. For each request, determine if it can be granted while keeping the system in a safe state. Identify the request that can be granted safely.
a P requesting two instances of R
b P requesting one instance of R
c P requesting two instances of R
d P requesting two instances of R
Consider a system in which processes post resource requests that are treated as follows. If the resource is free not currently held by any other process it is granted to the process. If the resource is currently held by some other process, the requesting process is thus notified. A process that could not obtain a requested resource can continue to post requests for more resources. However it cannot complete its work without obtaining all the resources it has requested. Whenever a process terminates it releases all the resources it had obtained.
In the following sequence of requests, let REQA B denote process A requesting resource B:
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
Construct a waitfor graph for the above sequence of requests. A waitfor graph has the set of processes as its vertices. An arc PiPj represents that process Pi is waiting for a resource that is held by process Pj Cycles in the waitfor graph correspond to deadlocks in the system. Based on the waitfor graph, identify the process, among those given below, that is NOT part of any deadlock.
a P
b P
c P
d P
Consider a system with eight resources currently allocated as follows:
Resource Allocated to Process
R P
R P
R P
R P
R P
R P
R P
R P
The following sequence of additional resource requests is then processed. Let REQAB denote process As request for resource B
REQP R
REQP R
REQP R
REQP R
REQP R
REQP R
The above sequence of requests do not cause a deadlock. Verify this fact by constructing a resourceallocation graph involving R through R and P through P
For each of the following resource requests, add an arc to the resourceallocation graph and examine if the resource request causes a deadlock in the system. Identify the request, among the following, that does NOT cause a deadlock.
a REQP R
b REQP R
c REQP R
d REQP R
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
