Operating System |Gate-2012| Previous year question|Set-9

Set-15 Operating System Questions

Operating System |Gate-2012|

1. 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 main memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL denote the number of page faults under the corresponding page replacements policy. Then : [GATE – 2012]

a. OPTIMAL < LRU < FIFO
b. OPTIMAL < FIFO < LRU
c. OPTIMAL = LRU
d. OPTIMAL = FIFO

Answer : b)


2. 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 : [GATE – 2012]

a. 3 Kbytes
b. 280 Kbytes
c. 35 Kbytes
d. dependent on the size of the disk

Answer : c)


3. 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 : [GATE – 2012]

a. fails as L can overflow
b. works correctly but may starve some processes
c. works correctly without starvation
d. fails as L can take on a non-zero value when the lock is actually available

Answer : d)


4. 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 : [GATE – 2012]

a. FCFS: P1, P2, P3 RR2: P1, P3, P2
b. FCFS: P1, P3, P2 RR2: P1, P3, P2
c. FCFS: P1, P2, P3 RR2: P1, P2, P3
d. FCFS: P1, P3, P2 RR2: P1, P2, P3

Answer : a)


5. A process executes the code

fork();
fork();
fork();

The total number of child processes created is : [GATE – 2012]

a. 3
b. 4
c. 7
d. 8

Answer : c)
Operating System |Gate-2012|


Back to GATE-HOME


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *