Consider a system with types of resources ( units), ( units), ( units), ( units). A non-preemptive resource allocation policy is used. At any given instance, a request is not entertained if it cannot be completely satisfied. Three processes , , request the resources as follows if executed independently.
Which one of the following statements is TRUE if all three processes run concurrently starting at time ?
View worked solution
Answer: A
To determine if a deadlock occurs, we trace the concurrent execution of the three processes. Let denote the active execution time (excluding blocked states) of process .
The total available resources initially are: , , , .
- At :
- (at ) requests units of Granted.
- (at ) requests units of Granted.
- (at ) requests unit of Granted.
- Available: .
- At :
- (at ) requests unit of Granted.
- Available: .
- At :
- (at ) requests unit of Granted.
- (at ) requests units of Granted.
- Available: .
- At :
- (at ) requests units of . Since only unit of is available, is Blocked.
- and continue executing ().
- At :
- (at ) requests unit of Granted.
- Available: .
- At :
- (at ) releases units of .
- Available: .
- Since units of are now available, the blocked request of is Granted, and unblocks.
- Available: .
- At :
- (at ) releases unit of .
- Available: .
- At :
- (at ) releases unit of and unit of .
- (at ) requests unit of Granted.
- Available: .
- At :
- (at ) finishes and releases all its held resources ().
- (at ) requests unit of Granted.
- Available: .
- At :
- (at ) releases unit of .
- (at ) finishes and releases all its held resources ().
- Available: .
- At :
- (at ) requests units of Granted.
- At :
- finishes successfully.
Since all three processes run to completion, no deadlock occurs.
Free practice · Your answers on this page are not saved.
