Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2016 Set 1
Questions

Q50

MCQ2 marks, −0.67Operating systemsHard

Consider the following proposed solution for the critical section problem. There are nn processes : P0....Pn−1P_0....P_{n-1}. In the code, function pmax\text{pmax} returns an integer not smaller than any of its arguments .For all i,t[i]i,t[i] is initialized to zero. Code for PiP_i;

do {
    c[i]=1; t[i]= pmax (t[0],....,t[n-1])+1; c[i]=0;
    for every j != i in {0,....,n-1} {
        while (c[j]);
        while (t[j] != 0 && t[j] <=t[i]);
    }
    Critical Section;
    t[i]=0;
    Remainder Section;
} while (true);

Which of the following is TRUE about the above solution?

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.