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

2008

A computer has 6 tape drives with ‘n’ processes competing for them. Each process may need two drives. For which values of ‘n’ is the system deadlock free

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    6

Attempted by 97 students.

Show answer & explanation

Correct answer: C

To determine the maximum number of processes 'n' that can run without deadlock, we use the necessary condition for deadlock freedom: Total Resources >= n(Max Need - 1) + 1. Here, there are 6 tape drives (Total Resources = 6), and each process needs a maximum of 2 drives (Max Need = 2). Substituting these values into the formula gives: 6 >= n(2 - 1) + 1, which simplifies to 5 >= n. This means the system is deadlock-free for any number of processes less than or equal to 5.\nLooking at the options, values 1, 2, and 3 all satisfy this condition (n <= 5). However, the question asks for a specific valid value among the choices. Option C (n=3) is a correct choice because 3 processes require at most 6 drives, but in the worst-case scenario where each holds one drive, only 3 are needed to be allocated to break the deadlock. Option D (n=6) is incorrect because 6 processes could each hold one drive and wait for another, causing a deadlock since only 6 drives exist. Thus, n=3 ensures sufficient resources to guarantee at least one process can complete.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor