1
GATE CSE 2014 Set 2
MCQ (Single Correct Answer)
+2
-0.6
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);
}
}
void consumer()
{
while(true)
{
semWait(s);
semWait(n);
removeFromBuffer();
semSignal(s);
consume();
}
}
Which one of the following is TRUE?2
GATE CSE 2014 Set 1
MCQ (Single Correct Answer)
+2
-0.6
An operating system uses the Banker’s algorithm for deadlock avoidance when managing the
allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given
below presents the current system state. Here, the Allocation matrix shows the current number of
resources of each type allocated to each process and the Max matrix shows the maximum number
of resources of each type required by each process during its execution.
There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is
currently in a safe state. Consider the following independent requests for additional resources in the current state:
REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z
3
GATE CSE 2010
MCQ (Single Correct Answer)
+2
-0.6
A system has n resources R0,.....,Rn-1, and k processes P0,.....,Pk-1. The
implementation of the resource request logic of each process Pi, is as follows:
if (i%2==0) {
if (i < n) request Ri;
if (i+2 < n) request Ri+2 ;
}
else {
if (i < n) request Rn-i;
if (i+2 < n) request Rn-i-2;
}
In which one of the following situations is a deadlock possible?4
GATE CSE 2009
MCQ (Single Correct Answer)
+2
-0.6
Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2 units). A non-preemptive resource allocation policy is used. At any given instance, a request is not entertained if it cannot be completely satisfied. Three processes P1, P2, P3 request the sources as follows if executed independently.
Which one of the following statements is TRUE if all three processes run concurrently starting at time t = 0?
Questions Asked from Deadlocks (Marks 2)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE 2024 Set 2 (1)
GATE CSE 2021 Set 1 (1)
GATE CSE 2018 (1)
GATE CSE 2016 Set 2 (1)
GATE CSE 2015 Set 3 (1)
GATE CSE 2014 Set 2 (1)
GATE CSE 2014 Set 1 (1)
GATE CSE 2010 (1)
GATE CSE 2009 (1)
GATE CSE 2008 (1)
GATE CSE 2007 (1)
GATE CSE 2006 (1)
GATE CSE 2005 (1)
GATE CSE 2000 (1)
GATE CSE 1997 (1)
GATE CSE 1993 (1)
GATE CSE 1992 (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