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

Synchronization

GATE CSE & IT · 31 questions across 22 years (1990-2026) · 55% recurrence rate

Recurrence sparkline

19902026
199020082026

Difficulty mix

easy 32%
med 52%
hard 16%

Question types

MCQ23
MSQ3
NAT2
STMT1
OTHER1

All 31 questions on Synchronization

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 shared variable initialized to 0 . Each...

Med
2024 PYQ

Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially $a = 1$ and $b = 1$. Though context switching between threads can happen at any time, each statement of T1 or T...

Med
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 variable x (initialized to 0). The threads...

Med
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, and 3 threads each invoking decr once, on...

Hard
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 standard wait( ) and signal( ). The threads...

Med
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 in line#7 is not atomic. 1. int counter =...

Med
2016 PYQ

Consider a non-negative counting semaphore $$S.$$ The operation $$P(S)$$ decrements $$S,$$ and $$V(S)$$ increments $$S.$$ During an execution, $$20$$ $$P(S)$$ operations and $$12$$ $$V(S)$$ operations are issued in some...

Med
2015 PYQ

The following two functions P1 and P2 that share a variable B with an initial value of 2 execute concurrently. P1( ) { C = B – 1; B = 2 * C; } P2( ) { D = 2 * B; B = D - 1; } The number of distinct values that B can poss...

Med
2014 PYQ

Consider the procedure below for the Producer-Consumer problem which uses semaphores: semaphore n = 0; semaphore s = 1; void producer() { while(true) { produce(); semWait(s); addToBuffer(); semSignal(s); semSignal(n); }...

Med
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 processes X and Y such that X computes the...

Med
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, stores it to memory, and then terminates....

Hard
2012 PYQ

Fetch_And_Add (X, i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by the value i, and returns the old value of X. It is used in the pseudocode shown below to impleme...

Hard
2009 PYQ

The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows: void enter_CS(X) { while test-and-set(X) ; } void leave_CS(X) { X=0; } In the abo...

Med
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 process waiting on s; Assume that P b and...

Med
2007 PYQ

Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes: /* P1 */ while(true){ want s1=true; while(wants2 == true){ /* Critical Section...

Med
2006 PYQ

Barrier is a synchronization construct where a set of processes synchronizes globally i.e. each process in the set arrives at the barrier and waits for all others to arrive and then all processes leave the barrier. Let t...

Hard
2006 PYQ

The atomic fetch-and-set x, y instruction unconditionally sets the memory location x to 1 and fetches the old value of x n y without allowing any intervening access to the memory location x. consider the following implem...

Med
2006 PYQ

Barrier is a synchronization construct where a set of processes synchronizes globally i.e. each process in the set arrives at the barrier and waits for all others to arrive and then all processes leave the barrier. Let t...

Hard
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'; Print '0'; X: } Process Q: while(1){...

Med
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'; Print '0'; X: } Process Q: while(1){...

Med
2001 PYQ

Consider Peterson’s algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below. Repeat flag[i]=true; turn=j; while (P) do no-op; Enter critical section, perfor...

Easy
1998 PYQ

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

Easy
1998 PYQ

A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4 V (signal) operations were completed on this semaphore. The resulting value of the semaphore

Easy
1997 PYQ

Each process P i ,i=1.....9 is coded as follows Repeat P(mutex){ critical section } V(mutex) Forever The code for P 10 is identical except that it uses V(mutex) in place of P(mutex). What is the largest number of process...

Med
1996 PYQ

A critical section is a program segment

Easy
1996 PYQ

A solution to the Dining Philosophers Problem which avoids deadlock is

Easy
1992 PYQ

At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and 15 V operations were completed on this semaphore. The resulting value of the semaphore is:

Easy
1991 PYQ

State whether the following statement TRUE or FALSE. Any implementation of a critical section requires the use of an indivisible machine instruction such as test-and-set.

Easy
1991 PYQ

State whether the following statement TRUE or FALSE. The use of monitors ensures that no dead -locks will be caused.

Easy
1990 PYQ

Semaphore operations are atomic because they are implemented within the OS

Easy
1990 PYQ

Match the pairs in the following Question. $$\eqalign{ & \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,List:\,{\rm I} \cr & \left( A \right)\,\,Criotical\,\,region \cr & \left( B \right)\,\,Wait/Signal \cr & \left( C \right)\,\,Working\...

Easy