Crack
GATE
C
G
Topic
Concurrency and Synchronization
Operating System
0
/ 10 done
Questions per paper
All
MCQ
MSQ
NAT
2015 to 2026. Point at a year to read it.
0
1
2015
2019
2021
2023
2025
2026
Show as a table
Year
All
MCQ
MSQ
NAT
2015
0.7
0.3
0
0.3
2018
0
0
0
0
2019
1
0
0
1
2020
1
1
0
0
2021
0.5
0
0.5
0
2022
1
1
0
0
2023
1
1
0
0
2024
1
0.5
0.5
0
2025
0
0
0
0
2026
0.5
0
0.5
0
1
CS 2026 Set 2 · 2 marks · MSQ · Moderate
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 and 0, respectively. X is a shared variable initialized to 0. Each line in the pseudocode is executed atomically.
2
CS 2024 Set 1 · 2 marks · MCQ · Moderate
Consider the following two threads T1 and T2 that update two shared variables
a
a
a
and
b
b
b
. Assume that initially
a
=
b
=
1
a = b = 1
a
=
b
=
1
. Though context switching between threads can happen at any time, each statement of T1 or T2 is executed atomically without interruption.
3
CS 2024 Set 2 · 2 marks · MSQ · Moderate
Consider a multi-threaded program with two threads T1 and T2. The threads share two semaphores:
s
1
s1
s
1
(initialized to 1) and
s
2
s2
s
2
(initialized to 0). The threads also share a global variable
x
x
x
(initialized to 0). The threads execute the code shown below.
4
CS 2023 · 2 marks · MCQ · Hard
Consider the two functions
i
n
c
r
\mathrm{incr}
incr
and
d
e
c
r
\mathrm{decr}
decr
shown below.
5
CS 2022 · 1 mark · MCQ · Moderate
Consider the following threads,
T
1
T_1
T
1
,
T
2
T_2
T
2
, and
T
3
T_3
T
3
executing on a single processor, synchronized using three binary semaphore variables,
S
1
S_1
S
1
,
S
2
S_2
S
2
, and
S
3
S_3
S
3
, operated upon using standard
w
a
i
t
(
)
\mathrm{wait}()
wait
(
)
and
s
i
g
n
a
l
(
)
\mathrm{signal}()
signal
(
)
. The threads can be context switched in any order and at any time.
6
CS 2021 Set 1 · 2 marks · MSQ · Hard
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. Assume that the increment operation in line#7 is
not
atomic.
7
CS 2020 · 2 marks · MCQ · Moderate
Each of a set of
n
n
n
processes executes the following code using two semaphores a and b initialized to 1 and 0, respectively. Assume that count is a shared variable initialized to 0 and not used in CODE SECTION P.
8
CS 2019 · 1 mark · NAT · Moderate
Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable
D
D
D
that has been initialized to 100.
9
CS 2015 Set 1 · 1 mark · NAT · Moderate
The following two functions
P
1
\mathrm{P1}
P1
and
P
2
\mathrm{P2}
P2
that share a variable
B
\mathrm{B}
B
with an initial value of
2
2
2
execute concurrently.
10
CS 2015 Set 3 · 1 mark · MCQ · Moderate
Two processes
X
X
X
and
Y
Y
Y
need to access a critical section. Consider the following synchronization construct used by both the processes