• edited by
1,745 views
0 0 votes

Consider two processes P1 and P2, each needed 3 resources 1, 2 and 3 in a database. If each processes ask them in any order, then the number of ways possible in which system is guaranteed to be deadlock-free ________.

Answer 120.

Similar to https://gateoverflow.in/220031/deadlock. It seems many answers are possible and no proper explanation is present.

1 Answer

0 0 votes
Say, P1 requests: R1, R2, R3 and P2 requests R1, R3, R2

p1 acess R1 then prempted then p2 start and will wait for R1,now p1 can finish its execution for any order of remaining 2 resources because both are available ,it means  order with this will be deadlock free,why this order is discarded?

according to me all order(arrangement) in which first resource request by p1 and p2 is same will be deadlock free ,because after aceesing first resouce by any one process if  prempted,other process will wait without holding any resouce,it means first process that wasprepted can continue its execution without deadlock.

in this way no of order come will be 120*2=240;please explain?
Position:
Show:

Related questions

0 0 votes
1 answers 1 answer
4.5k
4.5k views
Lakshman Bhaiya asked Dec 22, 2018
4,517 views
Consider a system which has $28$ instances of a resource $P$ such that $4+n$ processes share them,$4$ process request $5$ instances of $'P'.$ If $n$ process request $5$ i...
0 0 votes
1 answers 1 answer
2.2k
2.2k views
Satbir asked Nov 1, 2018
2,189 views
A system has 28 instances of resource P such that 4+n processes share them, 4 process request 5 instances of P. If n processes request 5 instances of same resource what i...
1 1 vote
1 1 answer
2.3k
2.3k views
sunita24 asked Dec 29, 2017
2,345 views
A system has 10 identical resources and N processes competing for them. Each process can request atmost 3 resources but by grouping of first 3 processes needs only 6 reso...