edited by
1,110 views
1 votes
1 votes

Consider a system with five processes $P_0$ through $P_4$ and three resource types $A, B$ and $C$. Resource type $A$ has seven instances, resource type $B$ has two instances and resource type $C$ has six instances suppose at time $T_0$ we have the following allocation.

If we implement Deadlock detection algorithm we claim that system is ________

  1. Semaphore
  2. Deadlock state
  3. Circular wait
  4. Not in deadlock state
edited by

2 Answers

1 votes
1 votes

The deadlock detection algo investigates every possible allocation sequences for the processes that remain to be completed.

The total allocated resources to all processes of resource type B doesn't match with that mentioned in the question. If we ignore the statement and take the tables as the right one then the solution is as follows:

Process P0 and P2 have been allocated all its resources and hence will run till completion. They will give up the resources they were allocated. This is the state:

Available:  A = 3    B = 1    C = 3

Processes left: P1   P3   P4

Process P1 requires: A = 2   B = 0   C = 2

We can fulfill its request. It will be allocated all the resources and will run till completion. Then it will give up all the resources. Now this will be the state:

Available: A = 5    B = 1    C = 3

Processes left: P3   P4

Similarly, next process P3 will be executed first and then P4.

Ans: option 4.

Answer:

Related questions

1 votes
1 votes
3 answers
1
Arjun asked Nov 5, 2017
837 views
Which of the following routing technique / techniques is/are used in distributed systems?Fixed RoutingVirtual RoutingDynamic Routing(a) only(a) and (b) only(c) onlyAll (a...
1 votes
1 votes
2 answers
3
Arjun asked Nov 5, 2017
908 views
The Sigmoid activation function $f(t)$ is defined as$\dfrac{1}{\text{exp} (t) + \text{exp} (-t)}$$t \text{ exp}(-t)$$\dfrac{1}{1+ \text{exp} (t)}$$\dfrac{1}{1+ \text{exp...