in Operating System
10,896 views
9 votes
9 votes

A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units, then

  1. Deadlock can never occur
  2. Deadlock may occur
  3. Deadlock has to occur
  4. None of these
in Operating System
by
10.9k views

7 Answers

18 votes
18 votes
Best answer

If the system is deadlocked, it implies that each process is holding one resource and is waiting for one more. Since there are 3 processes and 4 resources, one process must be able to obtain two resources. This process requires no more resources and therefore it will return its resources when done.

Hence,Option(A)deadlock can never occur.

selected by
4 votes
4 votes
  1. Deadlock can never occur

3 Comments

,deadlock May occur will be the answer. Let's say all process gets 1 resource each. Now there is a situation as to who out of three process will get the last resource to get their 2 process.
–1
–1
the remaining one process can be give to any one process..

so there is no waiting of process...see here

p1   1

p2    1

p3    1 now

1 process can be given to any one of (p 1,p2,p3) then no deadlock
0
0
still there is contention as to who will get that resource
0
0
4 votes
4 votes
To make a system deadlock free, assign each process with one less then their max need. After doing so if we are left with one or more resources then there is no deadlock.

Assign 1 resource (max need -1) to each process.

allocated resources=1+1+1=3

we are still left with 1 resource to avoid deadlock.

so deadlock can never occur. Answer (A)
2 votes
2 votes
Deadlock will never happen in such problem.

Suppose we hve three problem like P1,P2 and P3 now allocate each one only 1 unit and one unit is remaining nd this remaining can be given to any one to complete its execution and release the resources by which another can use it.So Deadlock will never be happen in such satuation.
Answer:

Related questions