A computer has 6 tape drives with n processes competing for them. Each process…

2026

A computer has 6 tape drives with n processes competing for them. Each process may need 2 drives. What is the maximum value of n for the system to be deadlock free ?

  1. A.

    3

  2. B.

    4

  3. C.

    5

  4. D.

    6

Attempted by 50 students.

Show answer & explanation

Correct answer: C

To ensure a system remains deadlock-free, we must guarantee that at least one process can always complete its execution. The worst-case scenario for deadlock occurs when every process holds the maximum number of resources it can hold without completing. Here, each process needs 2 tape drives but will be stuck holding only 1 drive while waiting for the second. With n processes, the maximum number of drives held without completing is n * (2 - 1) = n. To prevent deadlock, the total available resources must be greater than this worst-case sum by at least 1. Using the formula: Total Resources >= n * (Max Need - 1) + 1, we substitute the values: 6 >= n * (2 - 1) + 1. Simplifying gives 6 >= n + 1, which means n <= 5. Therefore, the maximum number of processes is 5. If there were 6 processes (Option D), each holding one drive would consume all resources, leaving none for any process to acquire the second needed drive, causing a deadlock. Similarly, while 3 or 4 processes (Options A and B) would also be safe, they are not the maximum possible value.

Explore the full course: Niacl Ao It Specialist