Operating System |Gate-2007| previous year question|Set-14

Set-15 Operating System Questions

Operating System |Gate-2007|

1. Group 1 contains some CPU scheduling algorithms and Group 2 contains some applications. Match entries in Group 1 to entries in Group 2. [GATE – 2007]

Group I                          Group II
(P) Gang Scheduling              (1) Guaranteed Scheduling
(Q) Rate Monotonic Scheduling    (2) Real-time Scheduling
(R) Fair Share Scheduling        (3) Thread Scheduling

a. P – 3 Q – 2 R – 1
b. P – 1 Q – 2 R – 3
c. P – 2 Q – 3 R – 1
d. P – 1 Q – 3 R – 2

Answer : a)


2. Consider the following statements about user level threads and kernel level threads. Which one of the following statements is FALSE? [GATE – 2007]

a. Context switch time is longer for kernel level threads than for user level threads.
b. User level threads do not need any hardware support.
c. Related kernel level threads can be scheduled on different processors in a multi-processor system.
d. Blocking one kernel level thread blocks all related threads.

Answer : d)


3. An operating system uses Shortest Remaining Time first (SRT) process scheduling algorithm. Consider the arrival times and execution times for the following processes:

Process  Execution time  Arrival time
P1             20            0
P2             25            15
P3             10            30
P4             15            45

What is the total waiting time for process P2? [GATE – 2007]

a. 5
b. 15
c. 40
d. 55

Answer : b)


4. A virtual memory system uses First In First Out (FIFO) page replacement policy and allocates a fixed number of frames to a process. Consider the following statements: [GATE – 2007]

P: Increasing the number of page frames allocated to a 
   process sometimes increases the page fault rate.
Q: Some programs do not exhibit locality of reference.

Which one of the following is TRUE?

a. Both P and Q are true, and Q is the reason for P
b. P is false, but Q is true
c. Both P and Q are true, but Q is not the reason for P
d. Both P and Q are false

Answer : c)


5. A single processor system has three resource types X, Y and Z, which are shared by three processes. There are 5 units of each resource type. Consider the following scenario, where the column alloc denotes the number of units of each resource type allocated to each process, and the column request denotes the number of units of each resource type requested by a process in order to complete execution. Which of these processes will finish LAST? [GATE – 2007]

    alloc           request
    X Y Z            X Y Z
P0  1 2 1            1 0 3
P1  2 0 1            0 1 2
P2  2 2 1            1 2 0

a. P1
b. P2
c. P0
d. None of the above, since the system is in a deadlock.

Answer : b)


6. Two processes, P1 and P2, need to access a critical section of code. Consider the following synchronization construct used by the processes:Here, wants1 and wants2 are shared variables, which are initialized to false. Which one of the following statements is TRUE about the above construct? [GATE – 2007]

  /* P1 */
while (true) {
  wants1 = true;
  while (wants2 == true);
  /* Critical
    Section */
  wants1=false;
}
/* Remainder section */       


/* P2 */
while (true) {
  wants2 = true;
  while (wants1==true);
  /* Critical
    Section */
  wants2 = false;
}
/* Remainder section */

a. It does not ensure 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.

Answer : d)


7. A process has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If optimal page replacement policy is used, how many page faults occur for the above reference string?  [GATE – 2007]

a. 7
b. 8
c. 9
d. 10

Answer : a)


8. A process has been allocated 3 page frames. Assume that none of the pages of the process are available in the memory initially. The process makes the following sequence of page references (reference string): 1, 2, 1, 3, 7, 4, 5, 6, 3, 1 If optimal page replacement policy is used, how many page faults occur for the above reference string? [GATE – 2007]

a. 0
b. 1
c. 2
d. 3

Answer : c)


9. Processes P1 and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program. get_exclusive_access ( ) { if (critical _flag == FALSE) { critical_flag = TRUE ; critical_region () ; critical_flag = FALSE; } } Consider the following statements. i. It is possible for both P1 and P2 to access critical_region concurrently. ii. This may lead to a deadlock. Which of the following holds? [GATE – 2007]  

a. (i) is false and (ii) is true
b. (i) is true and (ii) is false
c. Both (i) and (ii) are false
d. Both (i) and (ii) are false

Answer : b)


10. The address sequence generated by tracing a particular program executing in a pure demand paging system with 100 bytes per page is 0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0410. Suppose that the memory can store only one page and if x is the address which causes a page fault then the bytes from addresses x to x + 99 are loaded on to the memory. How many page faults will occur ? [GATE – 2007] 

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

Answer : c)


11. A demand paging system takes 100 time units to service a page fault and 300 time units to replace a dirty page. Memory access time is 1 time unit. The probability of a page fault is p. In case of a page fault, the probability of page being dirty is also p. It is observed that the average access time is 3 time units. Then the value of p is : [GATE – 2007]

a. 0.194
b. 0.233
c. 0.514
d. 0.981
e. 0.0194

Answer : e)
Operating System |Gate-2007|


12. The head of a hard disk serves requests following the shortest seek time first (SSTF) policy. The head is initially positioned at truck number 180. Which of the request sets will cause the head to change its direction after servicing every request assuming that the head does not change direction if there is a tie in SSTF and all the requests arrive before the servicing starts? [GATE – 2007]

a. 11, 139, 170, 178, 181, 184, 201, 265
b. 10, 138, 170, 178, 181, 185, 201, 265
c. 10, 139, 169, 178, 181, 184, 201, 265
d. 10, 138, 170, 178, 181, 185, 200, 265

Answer:  b)
Operating System |Gate-2007|


13. The head of a hard disk serves requests following the shortest seek time first (SSTF) policy. The head is initially positioned at track number 180. What is the maximum cardinality of the request set, so that the head changes its direction after servicing every request if the total number of tracks are 2048 and the head can start from any track? [GATE – 2007]

a. 9
b. 10
c. 11
d. 12

Answer : c)
Operating System |Gate-2007|


Back to GATE-HOME


Spread the love

Leave a Comment

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