GATE 2010 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2010

82 questions

MCQ 821-mark 39 · 2-mark 43

Questions 46–50 of 82

Q46Process Synchronization2 marksMCQ−0.67 if wrong
The following program consists of 3 concurrent processes and 3 binary semaphores. The semaphores are initialized as S0=1, S1=0, S2=0.
Process P0Process P1Process P2
while (true) {
   wait (S0);
    print ‘0’;
    release (S1);
    release (S2);
 }
wait (S1);
release (S0);
wait (S2);
release (S0);

How many times will process P0 print '0'?

Q47Process Synchronization1 markMCQ−0.33 if wrong
Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned.
Method used by P1Method used by P2
while (S1 == S2);
Critical Section
S1 = S2;
while (S1 != S2);
Critical Section
S2 = not(S1);

Which one of the following statements describes the properties achieved?

Q48Deadlock2 marksMCQ−0.67 if wrong
A system has n resources R0,...Rn−1R_{0},...R_{n-1}, and k processes P0,...Pk−1P_{0},...P_{k-1}. The implementation of the resource request logic of each process PiP_{i} is as follows:
 
if (i%2= = 0) {
        if (i<\ltn) request RiR_{i} ;
        if (i+2<\ltn)request Ri+2R_{i+2};
}
else {
         if (i<\ltn) request Rn−iR_{n-i};
         if (i+2<\ltn)request Rn−i−2R_{n-i-2} ;
} 
In which one of the following situations is a deadlock possible?

Q49CPU Scheduling1 markMCQ−0.33 if wrong
Which of the following statements are true?
I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time

Q50Memory Management1 markMCQ−0.33 if wrong
A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded to begin with. The system first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur?