retagged by
967 views
0 votes
0 votes

A system has $n$ resources $R_0, \dots,R_{n-1}$, and $k$ processes $P_0, \dots, P_{k-1}$. The implementation of the resource request logic of each process $P_i$ is as follows:

if(i%2==0){
    if(i<n) request Ri;
    if(i+2<n) request Ri+2;
}
else{
    if(i<n) request Rn−i;
    if(i+2<n) request Rn−i−2;
}

In which of the following situations is a deadlock possible?

  1. $n=40,\: k=26$
  2. $n=21,\:k=12$
  3. $n=20,\:k=10$
  4. $n=41,\:k=19$
retagged by

1 Answer

Answer:

Related questions

1 votes
1 votes
3 answers
2
1 votes
1 votes
3 answers
4
admin asked Mar 30, 2020
956 views
Which access method is used for obtaining a record from cassette tape?DirectSequentialRandom Parallel