Skip to content

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

GateBrew
← GATE CSE 2015 Set 3
Questions

Q10

MCQ1 mark, −0.33Operating systemsMedium

Two processes XX and YY need to access a critical section. Consider the following synchronization construct used by both the processes

/* Process X */
/* other code for process X */
while (true)
{
    varP = true;
    while (varQ == true)
    {
        /* Critical Section */
        varP = false;
    }
}
/* other code for process X */
/* Process Y */
/* other code for process Y */
while (true)
{
    varQ = true;
    while (varP == true)
    {
        /* Critical Section */
        varQ = false;
    }
}
/* other code for process Y */

Here varP and varQ are shared variables and both are initialized to false. Which one of the following statements is true?

Sign in to save attempts.

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