CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

A system has n resources R0,R1,....R1, and k processes P0,P1,....Pk1. 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 Rn1;
if (i +2< n) request Rn12;

In which one of the following situations is a deadlock possible?

Open in App
Solution

According to the given program, in all the cases for even sequences of processes only corresponding sequence number of recource will be allocated except case (b), where n=21, k=12, for P10R10 can be alloted and for P11R2111R10 can be alloted.
PiRi alloted and for odd sequence of process. i.e. PiRn1 that never conflict in any case except(b), when a same resource is requested by more than one process at the same time may lead to the deadlock.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Deadlock Characterization
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon