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

GATE 2012

82 questions

MCQ 821-mark 39 · 2-mark 43

Questions 46–50 of 82

Q46Process Synchronization2 marksMCQ−0.67 if wrong
Fetch_And_Add(X,i) is an atomic Read-Modify-Write instruction that reads the value of memory location X, increments it by the value i, and returns the old value of X. It is used in the pseudocode shown below to implement a busy-wait lock. L is an unsigned integer shared variable initialized to 0. The value of 0 corresponds to lock being available, while any non-zero value corresponds to the lock being not available.
 AcquireLock(L){
   while (Fetch_And_Add(L,1))
        L = 1;
}
ReleaseLock(L){
     L = 0;
} 
This implementation

Q47CPU Scheduling2 marksMCQ−0.67 if wrong
Consider the 3 processes, P1, P2 and P3 shown in the table.
Process Arrival time Time Units Required P1 0 5 P2 1 7 P3 3 4
The completion order of the 3 processes under the policies FCFS and RR2 (round robin scheduling with CPU quantum of 2 time units) are

Q48Memory Management2 marksMCQ−0.67 if wrong
Consider the virtual page reference string
1, 2, 3, 2, 4, 1, 3, 2, 4, 1
on a demand paged virtual memory system running on a computer system that has main memory size of 3 page frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacement policy. Then

Q49File Systems2 marksMCQ−0.67 if wrong
A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and the size of each disk block address is 8 Bytes. The maximum possible file size in this file system is

Q50ER Model1 markMCQ−0.33 if wrong
Given the basic ER and relational models, which of the following is INCORRECT?