An operating system contains user processes each requiring units of resource . The minimum number of units of such that no deadlocks will ever arise is
View worked solution
Answer: C
To find the minimum number of units of resource required to guarantee that a deadlock will never occur, we can analyze the worst-case allocation scenario where a deadlock is just about to happen.
Let:
- Number of processes,
- Maximum resource requirement for each process,
Worst-case allocation without progress:
Each process is allocated one unit less than its maximum requirement. In this state, every process is blocked waiting for its final resource, resulting in a deadlock if no more resources are available.
Deadlock Prevention:
If we add just more resource to this state, at least one process will get its maximum requirement, complete its execution, and release all its allocated resources back to the pool. This prevents any deadlock from occurring.
Thus, the minimum number of units of to ensure no deadlocks ever arise is 4.
Free practice · Your answers on this page are not saved.
