Process Synchronization MCQs: 10 Solved Cross-Concept Questions with Explanations

Solve 10 mixed Process Synchronization questions, then learn how shared state, atomic operations, waiting behaviour and lock ownership decide each answer.

KnowledgeGate Team

Exam prep & CS education

Updated 24 Oct 20267 min read

Mixed Process Synchronization questions switch among IPC, race conditions, busy waiting, monitors, address-space isolation and lock-aware scheduling. A correct answer begins with three decisions: what state is shared, which operation is atomic, and whether waiting spins or blocks. Misclassify any one and a familiar definition can point to the wrong option. The earlier 12-question Process Synchronization set owns the core progression through critical sections, Peterson's algorithm and semaphore ordering. This cross-concept set instead tests boundary changes between data exchange and coordination, process and thread scope, polling and blocking, and priority scheduling with locks.

Build one synchronization checklist before attempting the questions

Use four questions on every problem:

  1. What state is shared?

  2. Which read-modify-write steps can interleave?

  3. Does the primitive transfer data, protect data, or notify?

  4. Does a waiter spin, sleep, or continue?

With shared x = 10, T1 reads 10 at time 0, T2 reads 10 at time 1, T1 writes 11 at time 2, and T2 writes 11 at time 3. Both used stale 10, so two increments leave x = 11. Under a mutex, T1 writes 11 before T2 reads 11 and writes 12. Interleaved reads and writes cause the race, not the notation x = x + 1.

Shared memory and messages carry data; semaphores coordinate; monitors package state and synchronization; spinlocks repeatedly test.

Use the linked question pages for individual practice. When an item has no course-specific page, continue in the Process Synchronization learn module.

Two timelines for shared x=10: without a mutex both increments end at 11 and one update is lost, with a mutex they end at 12.

Questions 1-2: separate data exchange from a race condition

Question 1

Which mechanism allows processes to exchange data and messages directly?

TPSC 2024

  • (a) Semaphores

  • (b) Shared memory

  • (c) Pipes

  • (d) Signals

Answer: (b) Shared memory. It maps a common region. Semaphores coordinate, pipes use an OS channel, and signals notify. Multiple writers need synchronization.

Solve Question 1.

Question 2

When the result of a computation depends on the speed of the processes involved, there is said to be

GATE 1998

  • (a) cycle stealing

  • (b) race condition

  • (c) a time lock

  • (d) a deadlock

Answer: (b) race condition. Relative timing changes results. Deadlock means no progress; cycle stealing is unrelated; time lock is non-standard.

Questions 3-4: match the OS concept and classify IPC mechanisms

Question 3

Match the List I with List II

List I       List II

Critical Section  Hoare’s monitor

Wait/Signal    Mutual Exclusion

Working set    Principle of Locality

Deadlock     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) A-II, B-I, C-III, D-IV. Locality gives C-III, circular wait D-IV, critical section A-II, and wait/signal B-I. Eliminate before matching codes. This question also anchors the earlier Critical Section MCQs set, where it separates region, property and mechanism; here it tests a cross-domain switch from locality and deadlock back to synchronization.

Solve Question 3.

Question 4

Which of the following is not an IPC (Inter Process Communication) mechanism?

  • (a) Pipes

  • (b) Message passing

  • (c) Semaphores

  • (d) Paging

Answer: (d) Paging. Pipes and messages exchange data; semaphores coordinate and count as IPC here. Paging maps virtual to physical memory.

Questions 5-6: busy waiting, spinlocks and monitors

Question 5

Identify the correct statement(s) from the followings with respect to Spinlock Semaphores

A. The name refers to busy waiting semaphores.

B. They are not useful when the locks are to be held for a short duration of time.

C. It may require multiple context switches when a process waits on a lock.

D. They are often employed on Uniprocessor systems.

Choose the correct answer from the options given below:

UGC NET 2025

  • (a) A Only

  • (b) D Only

  • (c) B, D Only

  • (d) A, C and D Only

Answer: (a) A Only. A defines spinning. Short holds make B false; avoiding sleep makes C false. In the standard OS model, D is false because a uniprocessor waiter consumes the holder’s CPU.

Question 6

Monitor is an Interprocess Communication (IPC) technique which can be described as

UGC NET 2014

  • (a) It is higher level synchronization primitive and is a collection of procedures, variables, and data structures grouped together in a special package.

  • (b) It is a non-negative integer which apart from initialization can be acted upon by wait and signal operations.

  • (c) It uses two primitives, send and receive which are system calls rather than language constructs.

  • (d) It consists of the IPC primitives implemented as system calls to block the process when they are not allowed to enter critical region to save CPU time.

Answer: (a) A bounded-buffer monitor groups count, put(), get(), notFull and notEmpty. B is a semaphore, C message passing, D generic blocking.

Questions 7-8: test busy-waiting statements and process/thread memory

Question 7

Which of the following statements are CORRECT ?

(A) A process always check state of currently executing process to enter critical schema.

(B) Spin locks uses busy waiting.

(C) Periodically testing a variable until some value appear is known as busy waiting.

(D) Critical region is a part of program, where shared memory is kept.

(E) Printer daemon, continuously checks to see if there are any file to be printed.

Choose the correct answer from the options given below :

UGC NET 2023

  • (a) (A) and (B) Only

  • (b) (B), (C) and (E)

  • (c) (B) and (D) Only

  • (d) (B) and (E) Only

Answer: (b) (B), (C) and (E). A confuses execution with synchronization state. B and C define busy waiting. D confuses access with storage. Here E means polling, not a rule for every daemon.

Question 8

Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes P1 and P2, and each of the processes spawns two threads T1 and T2:

int x = 0; // global

Lock L1; // global

main () {

create a thread to execute foo( ); // Thread T1

create a thread to execute foo( ); // Thread T2

wait for the two threads to finish execution;

print(x);}

foo(){

int y = 0;

Acquire L1;

x = x + 1;

y = y + 1;

Release L1;

print (y);

}

Which of the following statement(s) is/are correct?

GATE 2021

  • (a) Both P1 and P2 will print the value of x as 2.

  • (b) At least of P1 and P2 will print the value of x as 4.

  • (c) At least one of the threads will print the value of y as 2.

  • (d) Both T1 and T2, in both the processes, will print the value of y as 1.

Answer: (a) and (d). Each process owns x and L1, so its threads serialize 0 -> 1 -> 2 and print 2. Each foo() owns fresh y, so threads print 1. Global is process-global.

Question 9: reason about mailbox AND, OR and empty conditions

Question 9

Consider the inter process communication scheme where mailboxes are used.

(a) Suppose process P wants to wait for two messages, one from mailbox A and one from mailbox B. What sequence of send and receive messages should it execute?

(b) What sequence of send and receive should P execute if P wants to wait for one message from mailbox A or from B (or from both)?

(c) A receive operation makes a process wait until the mailbox is non-empty. Devise a scheme that allows a process to wait until a mailbox is empty, or explain why such a scheme cannot exist.

HPSC Assistant Professor 2025

Answer. For (a), run receive(A, mA) then receive(B, mB). Either order works; P continues after both. Choosing A first can delay an available B message.

For (b), select(A, B) blocks until either is readable; break ties with A first. Otherwise, signal a shared event or semaphore and inspect both under a lock.

For (c), protect counts and empty conditions. Send increments countA; receive decrements it and signals emptyA at 0. Use while (countA != 0) wait(emptyA, mutex) to recheck wake-ups. Receive waits for the opposite, non-empty condition.

Solve Question 9.

Question 10: trace preemptive priority scheduling through two locks

Question 10

Consider the following given programs P1, P2 and P3 with execution time of process x,y and z being 4ms, 3ms and 5ms respectively:

Source listings for programs P1, P2 and P3 with their priorities, arrival times and lock operations.

Assume s and t are locks initially in free state and preemptive priority scheduling algorithm is used. Then average turnaround time is ___________: (round off 2 decimal places)

Correct answer: 26.33 ms. First transcribe the programs:

  • P1: process x; Lock(s); process z; unlock(s); process y; arrival 0, priority 1 (lowest).

  • P2: process x; Lock(s); Lock(t); process z; unlock(s); unlock(t); process y; arrival 5, priority 2.

  • P3: the same sequence as P2; arrival 15, priority 3 (highest).

  • x = 4 ms, y = 3 ms, z = 5 ms; s and t start free.

Trace P1:x 0-4, P1:z 4-5, P2:x 5-9, P1:z 9-13, P2:z 13-15, P3:x 15-19, P2:z 19-22, P3:z 22-27, P3:y 27-30, P2:y 30-33, P1:y 33-36. P2 blocks on P1’s s at 9; P3 blocks on P2’s s at 19, showing priority inversion.

Thus C1=36, C2=33, C3=30. Turnarounds are 36 - 0 = 36, 33 - 5 = 28, 30 - 15 = 15; average (36 + 28 + 15) / 3 = 79 / 3 = 26.33 ms. The earlier Priority Scheduling MCQs set owns policy choice, starvation and aging; this trace uses priority only to expose blocking and inversion across two locks.

Gantt timeline of P1, P2 and P3 under preemptive priority scheduling, showing lock blocking and an average turnaround time of 26.33 ms.

Score by concept family and choose the next step

Diagnose by cluster. For Q1-Q4, rebuild the IPC map; Q5-Q7, revise synchronization primitives; Q8, redraw memory scope; Q9, practise AND and OR waits; Q10, trace arrivals and locks.

The short version is to find shared state and waiting behaviour, then trace atomic operations and lock ownership.

Retry the missed cluster. Use GATE Guidance by Sanchit Sir for a structured sequence, then redo the trace without the explanation.