1
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes:
 /* P1 */
  while(true){
  want s1=true;
  while(wants2 == true){
  /* Critical Section */
   wants1 = false;
  }
  /* Reminder Section */
 }
 /* P2 */
  while(true){
  want s2=true;
  while(wants1 == true){
  /* Critical Section */
   Wants2 = false;
  }
  /* Reminder Section */
 }
Here wants1 and wants2 are shared variables, which are initialized to false. Which one of the following statements is TRUE about the above construct?
A
It does not ensure the mutual exclusion.
B
It does not ensure bounded waiting.
C
It requires that processes enter the critical section in strict alternation
D
It does not prevent deadlocks, but ensures mutual exclusion
2
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
An operating system uses Shortest Remaining Time first $$(SRT)$$ process scheduling algorithm. Consider the arrival times and execution times for the following processes: GATE CSE 2007 Operating Systems - Process Concepts and Cpu Scheduling Question 25 English

What is the total waiting time for process $$P2?$$

A
$$5$$
B
$$15$$
C
$$40$$
D
$$55$$
3
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C function:
int f(int n)
{
   static int r = 0;
   if(n <= 0) return 1;
   if(n>3)
   {
     r = n;
     return f(n-2)+2;
   }
  return f(n-1)+r;
}
What is the value of f(5)?
A
5
B
7
C
9
D
18
4
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
Consider the following finite state automation GATE CSE 2007 Theory of Computation - Finite Automata and Regular Language Question 58 English

The minimum state automation equivalent to the above $$FSA$$ has the following number of states

A
$$1$$
B
$$2$$
C
$$3$$
D
$$4$$
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