Question: Consider a system with four resource types as follows: Resource Type Number of Instances RT 1 6 RT 2 9 RT 3 1 2 RT
Consider a system with four resource types as follows:
Resource Type Number of Instances
RT
RT
RT
RT
The following table presents the maximum resource needs for each process for each of the four resource types:
Process Max RT Need Max RT Need Max RT Need Max RT Need
P
P
P
In the following sequence of resource requests, let REQA N N N N represent a request from process A for N resources of type RT N resources of type RT N resources of type RT and N resources of type RT:
REQP
REQP
REQP
REQP
REQP
REQP
The above sequence of resource requests can be granted safely without any danger of leading the system into a deadlock situation. Determine the set of resources available after processing the above sequence of requests and the remaining resource needs of the processes. Verify that a safe sequence of resource allocation to the processes does exist in this situation.
Now, consider the following additional requests for resources. For each request, determine if it can be granted safely in a manner that avoids deadlocks. Identify the request that can be safely granted.
a REQP
b REQP
c REQP
d REQP
Consider a system with ten resources and four processes competing for them. Let process P have a maximum need of seven resources, process P have a maximum need of five resources, process P have a maximum need of eight resources and process P have a maximum need of six resources.
Let a a a a represent the allocation vector with respect to the resources currently allocated to the processes P through P in that order. The system is deemed to be in a safe state with respect to an allocation vector if there is a possibility of allocating the remaining resources in such a way as to satisfy the maximum needs of all the processes.
Examine each of the following allocation vectors and determine if it is safe or not. Identify the one that is NOT safe?
a
b
c
d
In order to prevent deadlocks, let a system adopt the policy of forcing processes to request resources in ascending order of request type rank. In particular, when a process is requesting a resource of a certain type, the process cannot be holding other higher ranked resources.
Consider four resource types with the following profile in this system:
Resource Type Rank Number of Instances
RT
RT
RT
RT
Let the following sequence of resource requests be processed by the system note that REQA B k represents the request of k resources of type B by process A and RELA B k represents process A releasing k resources of type B:
REQP RT
REQP RT
REQP RT
RELP RT
REQP RT
RELP RT
RELP RT
REQP RT
REQP RT
REQP RT
Note that all of the above request and release operations can be processed without any violation of the deadlockprevention policy of the system.
For each of the following sequences of requestrelease operations, examine if it can or cannot be processed without violating the deadlockprevention scheme above. Identify the sequence that is allowed by the scheme and consequently can be processed without leading to system deadlock?
a RELP RT REQP RT REQP RT REQP RT
b REQP RT RELP RT REQP RT REQP RT
c RELP RT REQP RT REQP RT REQP RT
d REQP RT RELP RT REQP RT REQP RT
Consider six process P P P P P and P operating on four resources W X Y and Z Let REQA B denote that process A requests resource B and let RELA B denote that process A releases resource B
Let the system state be such that process P is holding resource W process P is holding resource X process P is holding resource Y and process P is holding resource Z Construct a resourceallocation graph reflecting this state of the system. For each of the following sequences of REQ and REL operations, modify the resourceallocation graph appropriately and determine if the sequence causes a deadlock. Identify the sequence that is deadlock free.
a REQP X REQP Z RELP X REQP X
b REQP X RELP X REQP X REQP Y
c REQP X RELP Y REQP W RELP Z
d REQP W REQP Z RELP Z REQP X
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
