02. Choose the correct alternatives (more than one may be correct) and write the corresponding letters only:
(xi) 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:
The case which you have taken will not lead to deadlock but if I consider this case for your example then there will be a deadlock.
So we need such a number of process in which if we try for any possibility deadlock should not occur!
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.
your assumption is good. But you should take care of question statement in the question statement it has been said that
here guaranteed word is used and due to this word your answer is not correct so if guaranteed is not used in question statement in that case you may be correct.
@GaneshA We can come up with many such allocation which will not cause deadlock. Question is asking "guaranteed to be deadlock free". Even if there is is a single case causing deadlock, it will not be considered.
Worst case allocation is all process gets one less than their maximum demand and all are blocked as after such assignment no one goes to completion.
Please explain, I am not able to understand.
If I take 4 processes as- P1, P2, P3, P4 and allocate resources as 1, 1, 1, 3 respectively, then P4 will complete its task and release the resources held by it and hence others can complete their task. And hence the system is deadlock free by taking 4 processes.
How come using 4 processes deadlock free is not guaranteed?
Please help where am I missing the concept.