A computer has six tape drives, with processes competing for them. Each process may need two drives. What is the maximum value of for the system to be deadlock free?
View worked solution
Answer: B
To ensure the system is guaranteed to be deadlock-free, we analyze the worst-case resource allocation scenario.
Let:
- (total number of tape drives available)
- = number of processes
- (maximum demand of each process )
In the worst-case scenario, each process is allocated one less than its maximum requirement, meaning each process holds exactly tape drive and is waiting for one more.
The total number of allocated drives in this state is:
For a deadlock to be impossible, the total number of resources must be strictly greater than this worst-case allocation, ensuring at least one process can get its remaining required resource and run to completion:
Since must be an integer, the maximum value of for the system to remain deadlock-free is .
Verification:
- If , each process holds drive (total allocated). The remaining free drive can be allocated to any process, allowing it to finish and release its resources.
- If , each process holds drive (total allocated). No free drives remain, resulting in a deadlock.
Free practice · Your answers on this page are not saved.
