edited by
10,715 views
34 34 votes

A computer system has $6$ tape devices, with n processes competing for them. Each process may need $3$ tape drives. The maximum value of n for which the system is guaranteed to be deadlock-free is:

  1. $2$
  2. $3$
  3. $4$
  4. $1$

4 Answers

Best answer
27 27 votes
Allocate max-$1$ resources to all processes and add one more resource to any process (Pigeon hole principle) so that this particular process can be completed (resources can be freed) and there is no deadlock.

Max resources required is $3$.

$\therefore (3-1)*n+1=6$

$n=\left \lfloor \frac{5}{2} \right \rfloor=2$

Correct Answer: $A$
edited by
21 21 votes

Answer: (A).

For $n=3$, $2-2-2$ combination of resources leads to deadlock.

For $n=2$, $3 - 3$ is the maximum need and that can always be satisfied.

edited by
3 3 votes
Don’t use formulas until and unless it’s necessary!

This can easily be solved with the help of intuition. Ultimately, we want that at least one process should get executed completely, so 1st process consumes 3 resources. We are left with 3 more, now if we take 2 more processes then what might happen is each of 3 processes consume 2-2 resources each because of which deadlock occurs. So, at max only 1 more process we can select and it will be consuming the remaining 3 resources. So, total of 2 processes which give n =2, option A. I hope it helped. :)
2 2 votes

We need to only that option in which system will always be deadlock free..

Case 1 if we have 4 processes.  indeed we do have possibility of deadlock with 4 processes.

p1 p2 p3 p4
1 1 1 1
1 1    


Case 2 if we have 3 processes. Again with 3 processes we can have deadlock

p1 p2 p3
1 1 1
1 1 1


Case 3 if we have 2 processes. With 2 processes we can never have deadlock in any configuration..

p1 p2
1 1
1 1
1 1


We have to discard all the cases where we can have deadlock..2 is the only option in which system will be deadlock free.

Answer:
Position:
Show:

Related questions

75 75 votes
9 answers 9 answers
39.5k
39.5k views
Kathleen asked Sep 13, 2014
39,475 views
The access times of the main memory and the Cache memory, in a computer system, are $500$ n sec and $50$ nsec, respectively. It is estimated that $80\%$ of the main memor...
31 31 votes
5 answers 5 answers
9.3k
9.3k views
Kathleen asked Sep 13, 2014
9,308 views
Context-free languages are:closed under unionclosed under complementationclosed under intersectionclosed under Kleene closure
56 56 votes
2 answers 2 answers
21.7k
21.7k views
Kathleen asked Sep 13, 2014
21,738 views
Consider the $\text{SLR(1)}$ and $\text{LALR (1)}$ parsing tables for a context free grammar. Which of the following statement is/are true?The goto part of both tables m...
50 50 votes
2 answers 2 answers
13.2k
13.2k views
Kathleen asked Sep 13, 2014
13,236 views
For a context free grammar, FOLLOW(A) is the set of terminals that can appear immediately to the right of non-terminal $A$ in some "sentential" form. We define two sets L...