Critical Section MCQs: 12 Solved Questions on Race Conditions and Mutual Exclusion
Practise critical-section MCQs on race conditions, mutual exclusion, Bakery ordering, stale writes and priority inversion, with explanations and two complete traces.
KnowledgeGate Team
Exam prep & CS education

Critical-section MCQs often hide the tested property behind a familiar mechanism, while short interleavings can turn one stale write into a different final value. These 12 questions cover critical sections, race conditions, mutual exclusion, protocol order, Bakery ordering, stale writes and priority inversion, including two fully traced shared-variable problems. The earlier Process Synchronization MCQ set surveys Peterson, semaphores and ordering; this focused set separates region, property and mechanism, then traces every legal merge. Choose an option before reading the explanation, and write per-thread order constraints before Questions 10 and 11.
Build one critical-section model before solving the MCQs
A process runs entry, critical, exit and remainder sections in that order. The critical section is a shared-state region; mutual exclusion is a property. Mutexes, semaphores, monitors, Peterson and Bakery are mechanisms.
With x = 5, P and Q can each read 5, compute 6, then write 6, losing one update. With lock 1, P acquires (1 -> 0), reads 5, writes 6 and releases (0 -> 1). Q acquires, reads 6, writes 7 and releases. The protected result is 7.
Mutual exclusion permits one occupant. Progress stops remainder work delaying a free section's decision. Bounded waiting prevents indefinite overtaking. See Process Synchronization and Semaphores for the wider lesson.

Critical Section MCQs 1-3: region, race and mutual exclusion
Question 1
A critical section is a program segment?
GATE 1996
A. which should run in a certain specified amount of time
B. which avoids deadlocks
C. where shared resources are accessed
D. which must be enclosed by a pair of semaphore operations, P and V
Answer: C.
The reads and writes of x form the critical section. Timing and deadlock are separate concerns. P/V is one possible mechanism. Solve Question 1.
Question 2
When the result of a computation depends on the order of the processes execution, there is said to be
GATE 1998
A. cycle stealing
B. race condition
C. a time lock
D. a deadlock
Answer: B.
A race makes the result timing-dependent: serialized increments give 7, but two reads of 5 give 6. This bank item also appears in the earlier survey, where it introduces synchronization broadly; here it anchors the narrower distinction between a critical-section region and mutual exclusion as a property. Deadlock instead prevents progress. Solve Question 2.
Question 3
A relationship between processes such that each has some part (critical section) which must not be executed while the critical section of another is being executed, is known as
UGC NET 2011
A. Semaphore
B. Mutual exclusion
C. Multiprogramming
D. Message passing
Answer: B.
The statement says occupants <= 1: mutual exclusion. A semaphore can enforce it; multiprogramming and message passing do not. Solve Question 3.
Critical Section MCQs 4-6: protocol order and the one-process invariant
Question 4
In design protocol of critical section problem, each process must ask permission to enter critical section in ________ code; it then executes in the critical section; once it finishes executes in the critical section it enters the_________ code. The process then enters the ________ code.
UGC NET 2022
A. entry section, remainder section, exit section
B. entry section, exit section, remainder section
C. remainder section, entry section, exit section
D. remainder section, exit section, entry section
Answer: B.
The order is entry -> critical -> exit -> remainder. Entry requests access; exit releases it. Option A delays release through remainder work. Solve Question 4.
Question 5
Suppose P,Q and R are co-operating processes satisfying Mutual Exclusion condition. Then, if the process Q is executing in its critical section then
UGC NET 2018
A. Both P and R execute in critical section
B. Neither P nor R executes in their critical section
C. P executes in critical section
D. R executes in critical section
Answer: B.
Q occupies the protected section. P and R may wait or run remainder code, but cannot enter their competing critical sections. Solve Question 5.
Question 6
Which of the following statements are TRUE about mutual exclusion in concurrent programming?
(A) Mutual exclusion ensures that only one process can be in a critical section at any given time.
(B) Mutual exclusion are designed to prevent conflicts and ensure that only one process can access shared resources at a time.
(C) Mutual exclusion can use various algorithms to ensure that processes do not enter the critical section simultaneously.
(D) Mutual exclusion allows multiple processes to access the critical section simultaneously to improve performance.
Choose the correct answer from the options given below:
UGC NET 2024
A. (A), (B), (C) Only
B. (B), (C), (D) Only
C. (B), (D), (A) Only
D. (A), (C), (D) Only
Answer: A.
A gives the definition, B the purpose and C the available algorithms. D contradicts exclusion. B remains conceptually correct despite its grammar. Solve Question 6.
Critical Section MCQs 7-9: false claims, concept pairs and the n-process algorithm
Question 7
Which of the following statements regarding mutual exclusion in operating systems is false?
NIACL AO IT 2023
A. No two processes can execute in their critical sections simultaneously.
B. Multiple processes can safely access a shared critical resource simultaneously without synchronization.
C. Processes outside the critical section should not interfere with processes inside the critical section.
D. Mutual exclusion helps prevent race conditions during shared resource access.
E. Only one process is allowed to access a critical resource at a time.
Answer: B.
The word false controls the solve. A, C, D and E respect protected access. B recreates the lost update. Immutable data is outside this case. Solve Question 7.
Question 8
Match the List I with List II
List I: A. Critical Section, B. Wait/Signal, C. Working set, D. Deadlock
List II: I. Hoare’s monitor, II. Mutual Exclusion, III. Principle of Locality, IV. Circular wait
UGC NET 2023
A. A–IV, B–I, C–III, D–II
B. A–II, B–I, C–III, D–IV
C. A–I, B–II, C–III, D–IV
D. A–IV, B–III, C–I, D–II
Answer: B.
Anchor working set with locality, C-III, and deadlock with circular wait, D-IV. Critical section matches mutual exclusion, leaving Wait/Signal with Hoare's monitor. Solve Question 8.
Question 9
Which of the following algorithms is used to solve the critical section problem for n processes?
UP LT Grade 2022
A. Peterson's algorithm
B. Moore algorithm
C. Banker's algorithm
D. Bakery algorithm
Answer: D.
Peterson is for two processes. Bakery orders n ticket pairs lexicographically: (4,0), (4,1), (5,2) admits P0, P1, P2. Banker addresses deadlock avoidance. Solve Question 9.
Critical Section MCQ 10: enumerate a two-thread race
Question 10
Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially a = b = 1. Though context switching between threads can happen at any time, each statement of T1 or T2 is executed atomically without interruption.
T1 T2
a = a + 1; b = 2 * b;
b = b + 1; a = 2 * a;Which one of the following options lists all the possible combinations of values of a and b after both T1 and T2 finish execution?
GATE 2024
A. (a = 4, b = 4); (a = 3, b = 3); (a = 4, b = 3)
B. (a = 3, b = 4); (a = 4, b = 3); (a = 3, b = 3)
C. (a = 4, b = 4); (a = 4, b = 3); (a = 3, b = 4)
D. (a = 2, b = 2); (a = 2, b = 3); (a = 3, b = 4)
Answer: A.
Call the statements A, B, C, D in displayed order, with A before B and C before D. The merges are ABCD -> (4,4), ACBD -> (4,3), ACDB -> (4,3), CABD -> (4,3), CADB -> (4,3), and CDAB -> (3,3). The reachable set is {(4,4), (4,3), (3,3)}. For a = 3, D precedes A. Then C precedes B, forcing b = 3; (3,4) is impossible. The earlier survey uses this same bank item as one synchronization trace; here all six legal merges prove the complete result set. Solve Question 10.

Critical Section MCQ 11: minimum and maximum after stale writes
Question 11
Consider three concurrent processes P1, P2 and P3, which access a shared variable D initialised to 100:
P1: D = D + 20P2: D = D + 50P3: D = D + 10The processes execute on a uniprocessor running a time-shared operating system. If the minimum and maximum possible final values of D are X and Y, respectively, what is Y - X?
UP LT Grade 2021
A. 110
B. 70
C. 80
D. 10
Answer: B.
Treat each assignment as read, compute, write. The serial maximum is 100 + 20 + 50 + 10 = 180. The minimum is 100 + 10 = 110: P3 computes 110 and pauses; P1 writes 120; P2 reads 120 and writes 170; P3 writes stale 110. Thus Y - X = 180 - 110 = 70. One CPU can switch between a non-atomic read and write. Solve Question 11.
Critical Section MCQ 12: priority inversion
Question 12
Purpose of priority inheritance protocol in synchronization mechanisms is
ISRO 2023
A. To prevent priority inversion in systems having two or lesser priorities for a resource
B. To provide mutual exclusion between threads and prevent data corruption
C. To prevent priority inversion and ensure fairness in resource allocation
D. To allow multiple threads to access any resource simultaneously
Answer: C.
L holds M, H blocks on M, and runnable N can pre-empt L. Inheritance raises L to H's priority until release. C identifies inversion; A adds a false limit, B is ordinary exclusion, and D breaks it. “Fairness” is broad option wording. Priority-scheduling question set owns scheduling policy, starvation, aging and the scheduling consequences of inversion; here Q12 tests why inheritance repairs a blocked critical-section lock handoff. Solve Question 12.
The short revision loop
Classify each term as region, property or mechanism. Write occupants <= 1. For races, preserve thread order and enumerate legal merges. Redraw Questions 10 and 11 until you can reproduce every bound without the explanation.
Continue with GATE Guidance by Sanchit Sir. Once both traces are reproducible unaided, use the GATE Test Series for timed practice.
Keep learning

Process Basics and PCB MCQs: 12 Solved Questions with Explanations
Solve 12 Process Basics and PCB questions, then use each explanation to repair the exact concept boundary behind the correct option.

Hardware Synchronization MCQs: 10 Solved Test-and-Set, Spinlock and Barrier Questions
Attempt 10 hardware synchronization questions, then check concise explanations of atomic instructions, busy waiting, lock failures and barrier races.

SJF and SRTF Scheduling MCQs: 11 Solved Questions with Step-by-Step Explanations
Solve 11 SJF and SRTF questions with ready-queue decisions, Gantt traces, waiting-time calculations and checked explanations.

Segmentation and Hybrid MCQs: 10 Solved OS Questions with Explanations
Solve ten memory-management MCQs, then check the keyed answers, short reasoning paths, distractor traps, and worked address calculations.