1
GATE CSE 2015 Set 3
MCQ (Single Correct Answer)
+2
-0.6
Consider the following policies for preventing deadlock in a system with mutually exclusive resources.

$$\,\,\,\,\,\,\,{\rm I}.$$ $$\,\,\,\,\,\,$$ Processes should acquire all their resources at the beginning of execution. If
$$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$$ any resource is not available, all resources acquired so far are released
$$\,\,\,\,\,{\rm II}.$$ $$\,\,\,\,\,\,$$ The resources are numbered uniquely, and processes are allowed to request
$$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$$ for resources only in increasing resource numbers
$$\,\,\,{\rm III}.$$ $$\,\,\,\,\,\,$$ The resources are numbered uniquely, and processes are allowed to request
$$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$$ for resources only in decreasing resource numbers
$$\,\,\,{\rm IV}.$$ $$\,\,\,\,\,\,$$ The resources are numbered uniquely. A process is allowed to request only
$$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$$ for a resource with resource number larger than its currently held resources

Which of the above policies can be used for preventing deadlock?

A
Any one of $${\rm I}$$ and $${\rm III}$$ but not $${\rm II}$$ or $${\rm IV}$$
B
Any one of $${\rm I},$$ $${\rm III},$$ and $${\rm IV}$$ but not $${\rm II}$$
C
Any one of $${\rm II}$$ and $${\rm III}$$ but not $${\rm I}$$ or $${\rm IV}$$
D
Any one of $${\rm I},$$ $${\rm II},$$ $${\rm III},$$ and $${\rm IV}$$
2
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?
A
The producer will be able to add an item to the buffer, but the consumer can never consume it.
B
The consumer will remove no more than one item from the buffer.
C
Deadlock occurs if the consumer succeeds in acquiring semaphore s when the buffer is empty.
D
The starting value for the semaphore n must be 1 and not 0 for deadlock-free operation.
3
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. GATE CSE 2014 Set 1 Operating Systems - Deadlocks Question 11 English 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

Which one of the following is TRUE?
A
Only REQ1 can be permitted.
B
Only REQ2 can be permitted.
C
Both REQ1 and REQ2 can be permitted.
D
Neither REQ1 nor REQ2 can be permitted
4
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?
A
n = 40, k = 26
B
n = 21, k = 12
C
n = 20, k = 10
D
n = 41, k = 19
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12