The GATE Grind

GATE Operating System: Concurrency and Synchronization – Previous Year Questions

11 GATE previous year questions on Concurrency and Synchronization (Operating System, Computer Science) with answers and explanations, from every paper.

  1. GATE 2016 CS Q60 (2 marks, Multiple choice) – Consider the following proposed solution for the critical section problem. There are n processes: P 0 P n-1. In the code, function `pmax` returns an…
  2. GATE 2015 CS Q30 (1 mark, Numerical answer) – The following two functions `P1` and `P2` that share a variable `B` with an initial value of 2 execute concurrently. The number of distinct values…
  3. GATE 2018 CS Q50 (2 marks, Multiple choice) – Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is N. Three semaphores empty, full and mutex…
  4. GATE 2019 CS Q33 (1 mark, Numerical answer) – Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable D that has been initialized to 100. P1 P2 P3 --- ---…
  5. GATE 2026 CS (CS2) Q51 (2 marks, Multiple select) – Consider three processes P 1, P 2, and P 3 running identical code shown below. A and B are binary semaphores initialized to 1 and 0, respectively. X…
  6. GATE 2024 CS (CS2) Q46 (2 marks, Multiple select) – Consider a multi-threaded program with two threads T1 and T2 sharing semaphores s1 (initialized to 1) and s2 (initialized to 0) and a global variable…
  7. GATE 2024 CS (CS1) Q40 (2 marks, Multiple choice) – Two threads T1 (a=a+1; b=b+1;) and T2 (b=2*b; a=2*a;) update shared variables a and b, initially a=b=1. Each statement is atomic. Which option lists…
  8. GATE 2023 CS Q38 (2 marks, Multiple choice) – Consider the two functions incr and decr shown below. There are 5 threads each invoking incr once, and 3 threads each invoking decr once, on the same…
  9. GATE 2022 CS Q19 (1 mark, Multiple choice) – Consider the following threads, T1, T2, and T3 executing on a single processor, synchronized using three binary semaphore variables, S1, S2, and S3,…
  10. GATE 2021 CS Q56 (2 marks, Multiple select) – Consider the following pseudocode, where S is a semaphore initialized to 5 in line#2 and counter is a shared variable initialized to 0 in line#1.…
  11. GATE 2020 CS Q44 (2 marks, Multiple choice) – Each of a set of n processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a…