1
GATE CSE 2012
MCQ (Single Correct Answer)
+2
-0.6
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 implement a busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value corresponds to the lock being not available.
AcquireLock(L){
While (Fetch_And_Add(L,1))
L = 1;
}
Release Lock(L){
L = 0;
}
This implementation 2
GATE CSE 2010
MCQ (Single Correct Answer)
+2
-0.6
The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0=1, S1=0, S2=0.
How many times will process P0 print '0'?
3
GATE CSE 2009
MCQ (Single Correct Answer)
+2
-0.6
The enter_CS() and leave_CS() functions to implement critical section of a process are realized using test-and-set instruction as follows:
I. The above solution to CS problem is deadlock-free
II. The solution is starvation free.
III. The processes enter CS in FIFO order.
IV More than one process can enter CS at the same time.
Which of the above statements is TRUE?
void enter_CS(X) {
while test-and-set(X) ;
}
void leave_CS(X) {
X=0;
}
In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following statements: I. The above solution to CS problem is deadlock-free
II. The solution is starvation free.
III. The processes enter CS in FIFO order.
IV More than one process can enter CS at the same time.
Which of the above statements is TRUE?
4
GATE CSE 2008
MCQ (Single Correct Answer)
+2
-0.6
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 Pb and Vb the wait and signal operations on binary semaphores are provided. Two binary semaphores Xb and Yb are used to implement the semaphore operations P(s) and V(s) as follows:
P(s): Pb (Xb);
S = s - 1;
if(s < 0){
Vb(Xb);
Pb(Yb);
}
Else Vb (Xb);
V(s): Pb (Xb);
S = s + 1;
if(s <= 0) Vb(Yb);
Vb(Xb);
The initial values of Xb and Yb are respectivelyQuestions Asked from Synchronization and Concurrency (Marks 2)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE 2024 Set 1 (2)
GATE CSE 2023 (1)
GATE CSE 2021 Set 2 (2)
GATE CSE 2020 (1)
GATE CSE 2013 (2)
GATE CSE 2012 (1)
GATE CSE 2010 (1)
GATE CSE 2009 (1)
GATE CSE 2008 (1)
GATE CSE 2007 (1)
GATE CSE 2006 (3)
GATE CSE 2003 (2)
GATE CSE 2001 (1)
GATE CSE 1997 (1)
GATE CSE 1996 (2)
GATE CSE 1992 (1)
GATE CSE 1990 (1)
GATE CSE 1987 (1)
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages