Time Left - 15:00 mins

GATE CS 2021 : Operating System Quiz 5

Attempt now to get your rank among 474 students!

Question 1

Consider the following two-process synchronization solution
Process 0
---------
Entry: loop while (turn == 1); (critical section)
Exit: turn = 1;
Process 1
-----------
Entry: loop while (turn == 0); (critical section)
Exit: turn = 0;
The shared variable turn is initialized to zero. Which one of the following is TRUE?

Question 2

The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently.
P1()
{
C = B – 1;
B = 2*C;
}

P2()
{
D = 2 * B;
B = D - 1;
}
 
The number of distinct values that B can possibly take after the execution is ___________.

Question 3

Consider the following statements about Consumer-Producer problem. Which one of the following statement is True?

Question 4

Test & Set Lock is not free from ?

Question 5

Strict alteration approach or turn variable approach will ensure

Question 6

Which of the following implementation may waste CPU cycle.
  • 474 attempts
  • 7 upvotes
  • 6 comments
Aug 31GATE & PSU CS