edited by
1,026 views
0 votes
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.

edited by

1 Answer

0 votes
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?

Related questions

1 votes
1 votes
1 answer
2
0 votes
0 votes
1 answer
3
aaru14 asked Dec 10, 2017
452 views
https://gateoverflow.in/?qa=blob&qa_blobid=16406706223773445572someone plz help how to detect deadlock in this type of question??
0 votes
0 votes
1 answer
4