Concurrency and Synchronization
Study notes are awaiting editorial approval. You can still practise the reviewed questions below.
Related previous-year questions
Practise this topic- 2026 · Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A and B are two binary semaphores initialized to 1 a
- 2024 · 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 betwe
- 2024 · Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The t
- 2023 · Consider the two functions `incr` and `decr` shown below. ```c incr(){ wait(s); X = X+1; signal(s); } decr(){ wait(s); X = X-1; signal(s); } ``` The
- 2022 · Consider the following threads, $T_1$, $T_2$, and $T_3$ executing on a single processor, synchronized using three binary semaphore variables, $S_1$, $
- 2021 · 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. Assu
- 2020 · 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 s
- 2019 · 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 |
- 2018 · Consider the following solution to the producer-consumer synchronization problem. The shared buffer size is $N$. Three semaphores empty, full and mute
- 2017 · A multithreaded program $P$ executes with $x$ number of threads and uses $y$ number of locks for ensuring mutual exclusion while operating on shared m
- 2016 · Consider the following two-process synchronization solution. ```text Process 0 Process 1 --------- --
- 2016 · Consider a non-negative counting semaphore $S$. The operation $P(S)$ decrements $S$, and $V(S)$ increments $S$. During an execution, $20\, P(S)$ opera