1
GATE CSE 2018
MCQ (Single Correct Answer)
+2
-0.6
In a system, there are three types of resources: $$E, F$$ and $$G.$$ Four processes $${P_0},$$ $${P_1},$$ $${P_2}$$ and $${P_3}$$ execute concurrently. At the outset, the processes have declared their maximum resource requirements using a matrix named Max as given below. For example, Max$$\left[ {{P_{2,}}F} \right]$$ is the maximum number of instances of $$F$$ that $${{P_{2,}}}$$ would require. The number of instances of the resources allocated to the various processes at any given state is given by a matrix named Allocation.

Consider a state of the system with the Allocation matrix as shown below, and in which $$3$$ instances of $$E$$ and $$3$$ instances of $$F$$ are the only resources available.

Allocation
E F G
P0 1 0 1
P1 1 1 2
P2 1 0 3
P3 2 0 0

Max
E F G
P0 4 3 1
P1 2 1 4
P2 1 3 3
P3 5 4 1

From the perspective of deadlock avoidance, which one of the following is true?

A
The system is in $$safe$$ state.
B
The system is not in $$safe$$ state, but would be $$safe$$ if one more instance of $$E$$ were available
C
The system is not in $$safe$$ state, but would be $$safe$$ if one more instance of $$F$$ were available
D
The system is not in $$safe$$ state, but would be $$safe$$ if one more instance of $$G$$ were available
2
GATE CSE 2016 Set 2
Numerical
+2
-0
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 order. The largest initial value of $$S$$ for which at least one $$P(S)$$ operation will remain blocked is _____________ .
Your input ____
3
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}$$
4
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.
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12