Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

semaphores

GATE CSE & IT · Operating Systems - Concurrency and Synchronization · 2003-2026

11
PYQs
100%
keyed
0
elite explanations
8
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2026 PYQ

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...

mediumanswer keybasic explanation
2024 Q46

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 threads also share a global var...

mediumanswer key
2024 PYQ

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 threads also share a global var...

mediumanswer keybasic explanation
2023 PYQ

Consider the two functions incr and decr shown below. incr() { wait(s); X = X+1; signal(s); } decr() { wait(s); X = X-1; signal(s); } There are 5 threads each invoking incr once, a...

hardanswer keybasic explanation
2022 PYQ

Consider the following threads, T 1 , T 2 and T 3 executing on a single processor, synchronized using three binary semaphore variables, S 1 , S 2 and S 3 , operated upon using stan...

mediumanswer keybasic explanation
2021 PYQ

Consider the following pseudocode, where S is a semaphore intialized to 5 in line#2 an counter is a shared variable intialized to 0 in line#1. Assume that the increment operation i...

mediumanswer keybasic explanation
2013 PYQ

A shared variable x, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W and X reads x from memory, increments by one, s...

hardanswer key
2013 PYQ

A certain computation generates two arrays a and b such that a[i]=f(i)for 0 ≤ i < n and b[i] = g (a[i] )for 0 ≤ i < n. Suppose this computation is decomposed into two concurrent pr...

mediumanswer key
2008 PYQ

The P and V operations on counting semaphores, where s is a counting semaphore, are defined as follows: P(s): s = s-1; if s < 0 then wait; V(s) : s = s-1; ifs <= 0 then wakeup a pr...

mediumanswer key
2003 PYQ

Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below. Process P: while(1){ W: Print '0...

mediumanswer key
2003 PYQ

Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below. Process P: while(1){ W: Print '0...

mediumanswer key