Skip to content

GATE CS Concurrency and Synchronization questions

Practise Concurrency and Synchronization questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

18 on this page
Official PYQ2009Operating SystemConcurrency and SynchronizationMCQ · 1 mark
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 above solution, XX is a memory location associated with the CSCS and is initialized to 00. Now consider the following statements: The …
Official PYQ2008Operating SystemConcurrency and SynchronizationMCQ · 1 mark
The PP and VV operations on counting semaphores, where s is a counting semaphore, are defined as follows: P(s):P(s): s=s−1;s=s-1; If s<0s < 0 then wait; V(s):V(s): s=s+1;s=s+1; If s≤0s \leq0 then wake up process waiting on s; Assume that PbP_b and VbV_b the wait and signal operations on binary semaphores are provided. Two binary semaphores xbx_b …
Official PYQ2007Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Two processes, P1P1 and P2P2, need to access a critical section of code. Consider the following synchronization construct used by the processes: /* P1 */ while (true) { wants1 = true; while (wants2 == true); /* Critical Section */ wants1 = false; } /* Remainder section */ /* P2 */ while (true) { wants2 = true; while (wants1 == true); /* Critical Section …
Official PYQ2006Operating SystemConcurrency and SynchronizationMCQ · 1 mark
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 the number of processes in the set be three and SS be a binary semaphore with the usual PP and VV functions. Consider the following …
Official PYQ2006Operating SystemConcurrency and SynchronizationMCQ · 1 mark
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 the number of processes in the set be three and SS be a binary semaphore with the usual PP and VV functions. Consider the following …
Official PYQ2006Operating SystemConcurrency and SynchronizationMCQ · 1 mark
The atomic fetch-and-set x,yx, y instruction unconditionally sets the memory location xx to 11 and fetches the old value of xx in yy without allowing any intervening access to the memory location xx. Consider the following implementation of PP and VV functions on a binary semaphore SS. void P (binary_semaphore *s) { unsigned y; …
Official PYQ2004Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Consider two processes P1P_1 and P2P_2 accessing the shared variables XX and YY protected by two binary semaphores SXS_X and SYS_Y respectively, both initialized to 1. PP and VV denote the usual semaphore operators, where PP decrements the semaphore value, and VV increments the semaphore value. The pseudo-code of P1P_1 and P2P_2 …
Official PYQ2003Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Suppose we want to synchronize two concurrent processes PP and QQ using binary semaphores SS and TT. The code for the processes PP and QQ is shown below. …
Official PYQ2003Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Suppose we want to synchronize two concurrent processes PP and QQ using binary semaphores SS and TT. The code for the processes PP and QQ is shown below. Process P: Process Q: while(1){ W: print '0'; print '0'; X: } while(1){ Y: print '1'; print '1'; Z: } Synchronization statements can be inserted only at points W,X,Y,W, X, Y, and ZZ Which …
Official PYQ2001Operating SystemConcurrency and SynchronizationMCQ · 1 mark
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, perform actions, then exit critical section Flag[i] = false; Perform other non-critical section actions. Until false; For the program to …
Official PYQ2000Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Let m[0]…m[4]m[0]\ldots m[4] be mutexes (binary semaphores) and P[0]…P[4]P[0]\ldots P[4] be processes. Suppose each process P[i]P[i] executes the following: wait (m[i]); wait (m(i+1) mod 4]); ........... release (m[i]); release (m(i+1) mod 4]); This could cause
Official PYQ1998Operating SystemConcurrency and SynchronizationMCQ · 1 mark
A counting semaphore was initialized to 1010. Then 6P6 P (wait) operations and 4V4V (signal) operations were completed on this semaphore. The resulting value of the semaphore is
Official PYQ1998Operating SystemConcurrency and SynchronizationMCQ · 1 mark
When the result of a computation depends on the speed of the processes involved, there is said to be
Official PYQ1997Operating SystemConcurrency and SynchronizationMCQ · 1 mark
Each Process Pi,i=1…9P_i, i = 1\ldots 9 is coded as follows repeat P(mutex) {Critical section} V(mutex) forever The code for P10P_{10} is identical except it uses V(mutex) in place of P(mutex). What is the largest number of processes that can be inside the critical section at any moment?
Official PYQ1996Operating SystemConcurrency and SynchronizationMCQ · 1 mark
A solution to the Dining Philosophers Problem which avoids deadlock is to
Official PYQ1996Operating SystemConcurrency and SynchronizationMCQ · 1 mark
A critical section is a program segment
Official PYQ1992Operating SystemConcurrency and SynchronizationMCQ · 1 mark
At a particular time of computation, the value of a counting semaphore is 77. Then 2020 PP operations and 1515 VV operations were completed on this semaphore. The resulting value of the semaphore is :
Official PYQ1987Operating SystemConcurrency and SynchronizationMCQ · 1 mark
A critical region is