A computer has six tape drives with 𝑛 processes competing for them. Each…
2019
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?
- A.
5
- B.
4
- C.
3
- D.
6
Attempted by 403 students.
Show answer & explanation
Correct answer: A
Answer: 5 processes
Key reasoning:
There are 6 identical tape drives and each process may need up to 2 drives.
A deadlock situation would require every competing process to hold one drive and wait for a second drive.
If there are 6 processes, each can hold one drive and wait for another, so a deadlock is possible.
If there are 5 processes, at least one drive remains free. That free drive can be allocated to one process so it obtains its second drive, completes, and releases its drives, allowing other processes to proceed. Thus deadlock cannot occur.
Therefore the maximum number of processes that guarantees the system is deadlock-free is 5.
A video solution is available for this question — log in and enroll to watch it.