A computer system has tape devices, with n processes competing for them. Each process may need tape drives. The maximum value of n for which the system is guaranteed to be deadlock-free is:
View worked solution
Answer: A
To guarantee that the system is deadlock-free, we analyze the worst-case resource allocation scenario.
Let:
- (total number of tape devices)
- = number of processes
- (maximum demand of each process )
In the worst-case scenario, each of the processes is allocated one resource less than its maximum requirement, and no resources are left free. Under this condition, every process is blocked, resulting in a deadlock.
The maximum number of resources allocated in this worst-case state is:
To guarantee that a deadlock never occurs, the total number of available resources must be strictly greater than this worst-case allocation, ensuring at least one process can always get its remaining required resource and run to completion:
Substitute the given values into the inequality:
Since the number of processes must be an integer, the maximum value of for which the system is guaranteed to be deadlock-free is .
Free practice · Your answers on this page are not saved.
