# What is the correct answer of given problem?

Consider a system having m resources of same type and 3 process A,B and C have peak demands of 3,4 and 6 respectiveley.

What should be the value of m such that the deadlock will not occur ?

My Analysis :

If we consider the worst case , 2 for A ,3 for B and 5 for C (2+3+5=10) resources are currently allocated . So in addition to that , one more resource if allocated to any one of the process will prevent the occurance of deadlock.

So , the answer is 11 . Is this correct ? or is there any other answer that contradicts above

• No. You only need two processes to be attempting to lock a resource for deadlock to occur, so in your analysis of the worst case, one of your 3 processes could already have allocated its maximum usage, making the answer 12. Commented Jan 28, 2015 at 10:59
• Can you please explain in detail ? Commented Jan 28, 2015 at 11:02
• @Jules: Your logic is flawed if there is a third process that can make resources available that are acceptable to either of the waiting processes. Commented Jan 28, 2015 at 14:07