Question
A system has n resources R0,R1,....R1, and k processes P0,P1,....Pk−1. The implementation of the resource request logic of each process Pi, 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−1;
if (i +2< n) request Rn−1−2;
In which one of the following situations is a deadlock possible?