GateAI
Concurrency and Synchronization

GATE CSE 2016 Set 2 · Q48

MCQ2 marksMedium

Time

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

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) This solution violates progress requirement.

Concurrency and Synchronization

This algorithm is the classic strict alternation (or lock with turn variable) solution for two processes.

  1. Mutual Exclusion: Satisfied. The shared variable turn can only hold either 00 or 11 at any time, so both processes can never be in the critical section simultaneously.

  2. Progress: Violated. The processes are forced to take turns strictly in the sequence 0,1,0,1,…0, 1, 0, 1, \dots. If Process 00 finishes its critical section and sets turn = 1, and then Process 11 completes its turn and sets turn = 0, Process 11 cannot re-enter the critical section if Process 00 is not interested in entering. Thus, a process outside its critical section prevents another process from entering.

  3. Bounded Waiting: Satisfied. Neither process has to wait for more than one turn.

Therefore, the solution violates the progress requirement, making (C) the correct option [CS-2, Q48].

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Concurrency and Synchronization previous year question is Q48 of the GATE CSE 2016 Set 2 paper. Find more GATE CSE PYQs on Concurrency and Synchronization in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Concurrency and Synchronization PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Concurrency and Synchronization in GATE CSE

Concurrency and Synchronization has 18 GATE CSE PYQs across 15 papers from 2012 to 2026. 9 of them are 2-mark MCQs like this one, and GATE CSE 2016 Set 2 has 2.

How GATE tests Concurrency and Synchronization

More from GATE CSE 2016 Set 2

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2016 Set 2 · Q48 · MCQ

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

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.