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

GATE 2003

107 questions

MCQ 1071-mark 107

Questions 91–95 of 107

Q91Process Synchronization1 markMCQ−0.33 if wrong
Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.
 Process P:
while (1) {
W:
   print '0';
   print '0';
X:
}
 
Process Q:
while (1) {
Y:
   print '1';
   print '1';
Z:
}
Synchronization statements can be inserted only at points W, X, Y and Z.
Which of the following will ensure that the output string never contains a substring of the form 01n001^{n}0 or 10n110^{n}1, where n is odd?

Q92Process Synchronization1 markMCQ−0.33 if wrong
Suppose we want to synchronize two concurrent processes P and Q using binary semaphores S and T. The code for the processes P and Q is shown below.
 Process P:
while (1) {
W:
   print '0';
   print '0';
X:
}
 
Process Q:
while (1) {
Y:
   print '1';
   print '1';
Z:
}
Synchronization statements can be inserted only at points W, X, Y and Z.

Which of the following will always lead to an output staring with '001100110011' ?

Q93Deadlock1 markMCQ−0.33 if wrong
The following are the starting and ending times of activities A,B,C,D,E,F,G and H respectively in chronological order: as  bs  cs  ae  ds  ce  es  fs  be  de  gs  ee  fe  hs  ge  hea_{s}\; b_{s} \; c_{s}\;a_{e}\;d_{s}\;c_{e}\;e_{s}\;f_{s}\;b_{e}\;d_{e}\;g_{s}\;e_{e}\;f_{e}\;h_{s}\;g_{e}\;h_{e}. Here, xsx_{s} denotes the starting time and xex_{e} denotes the ending time of activity X. W need to schedule the activities in a set of rooms available to us. An activity can be scheduled in a room only if the room is reserved for the activity for its entire duration. What is the minimum number of rooms required?

Q94CPU Scheduling1 markMCQ−0.33 if wrong
A uni-processor computer system only has two processes, both of which alternate 10 ms CPU bursts with 90 ms I/O bursts. Both the processes were created at nearly the same time. The I/O of both processes can proceed in parallel. Which of the following scheduling strategies will result in the least CPU utilizations (over a long period of time) for this system ?

Q95Memory Management1 markMCQ−0.33 if wrong
A processor uses 2-level page tables for virtual to physical address translation. Page tables for both levels are stored in the main memory. Virtual and physical addresses are both 32 bits wide. The memory is byte addressable. For virtual to physical address translation, the 10 most significant bits of the virtual address are used as index into the first level page table while the next 10 bits are used as index into the second level page table. The 12 least significant bits of the virtual address are used as offset within the page. Assume that the page table entries in both levels of page tables are 4 bytes wide. Further, the processor has a translation look-aside buffer (TLB), with a hit rate of 96%. The TLB caches recently used virtual page numbers and the corresponding physical page numbers. The processor also has a physically addressed cache with a hit rate of 90%. Main memory access time is 10 ns, cache access time is 1 ns, and TLB access time is also 1 ns.

Suppose a process has only the following pages in its virtual address space: two contiguous code pages starting at virtual address 0x00000000, two contiguous data pages starting at virtual address 0x00400000, and a stack page starting at virtual address 0xFFFFF000. The amount of memory required for storing the page tables of this process is: