Subjects Subjects About Login

OS : 2009 GATE Questions

Questions : 6

QID : 260GATE-2009, 1M

In which one of the following page replacement policies, Belady’s anomaly may occur?

B) Optimal
Ans : Option A
Solution :
Only FIFO may suffer from Belady's anomaly which states that increase in number of frames may increase the page fault rate sometimes.
QID : 263GATE-2009, 2M

Now consider the following statements:

I. If a process makes a transition D, it would result in another process making transition A immediately
II. A process P2 in blocked state can make transition E while another process P1 is in running state
III. The OS uses preemptive scheduling
IV. The OS uses non-preemptive scheduling

Which of the above statements are TRUE?

A) I and II
B) I and III
C) II and III
D) II and IV
Ans : Option C
Solution :
I. Termination of one process doesn't necessarily create another new process.
II. A process can move to ready state when I/O completes irrespective of other process being in running state or not.
III. Its preemptive because there is a transition from running to ready state
QID : 69GATE-2009, 2M

Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2 units). A non-preemptive resource allocation policy is used. At any given instance, a request is not entertained if it cannot be completely satisfied. Three processes P1, P2, P3 request the sources as follows if executed independently.

Which one of the following statements is TRUE if all three processes run concurrently starting at time t=0?

A) All processes will finish without any deadlock
B) Only P1 and P2 will be in deadlock.
C) Only P1 and P3 will be in a deadlock.
D) All three processes will be in deadlock.
Ans : Option A
Solution :
Lets track Availability of resources at each time unit.
If All processes waits simultaneously for any resource, its deadlock.

R1 R2 R3 R4 = 3 2 3 2

t=0 , 3 0 1 1
t=1 , 3 0 0 1
t=2 , 1 0 0 0
t=3 , 1 0 0 0
(at t=3, 2 units of R1 not available. So P1 starts waiting.)

t=4 , 0 0 0 0
t=5 , 0 0 0 0
(at t=5, P3 release 2units of R2 and P1 takes these & continues
Now P1 is started again and further timeline of P1 is shifted by 2 units of time.
i.e. t=3 is now t=5,
t=5 will be t=7,
t=7 will be t=9,
t=8 will be t=10,
t=10 will be t=12)
lets continue:
t=6 , 0 0 1 0
t=7 , 1 0 1 0
t=8 , 2 0 1 1
(at t=8, P2 will release all resources its holding)
t=9 , 2 1 3 2
(at t=9, P3 will release all resources its holding)
t=10 , 2 1 3 0
t=11 , 2 1 3 0
t=12 , 3 2 3 2

All processes completed without waiting forever. So no deadlock
QID : 261GATE-2009, 1M

The essential content(s) in each entry of a page table is / are

A) Virtual page number
B) Page frame number
C) Both virtual page number and page frame number
D) Access right information
Ans : Option B
Solution :
The main purpose of page table is to store the frame number.
Its not necessary to store the page number in page table because the index of each row in table itself indicates the page number.
QID : 265GATE-2009, 1M

A multilevel page table is preferred in comparison to a single level page table for translating virtual address to physical address because

A) It reduces the memory access time to read or write a memory location.
B) It helps to reduce the size of page table needed to implement the virtual address space of a process.
C) It is required by the translation lookaside buffer.
D) It helps to reduce the number of page faults in page replacement algorithms.
Ans : Option B
Solution :
Size of the first level page table may become too large which is OS can't afford to store in Main Memory. So multilevel paging is required to divide the fist level PT in multiple parts and then load only the required part using second level page table.
QID : 262GATE-2009, 2M

Consider a disk system with 100 cylinders. The requests to access the cylinders occur in following sequence:

4, 34, 10, 7, 19, 73, 2, 15, 6, 20

Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1ms to move from one cylinder to adjacent one and shortest seek time first policy is used?

A) 95ms
B) 119ms
C) 233ms
D) 276ms
Ans : Option B
Solution :
Cylinders are accessed in following order
34, 20, 19, 15, 10, 7, 6, 4, 2, 73

and total time will be (16 + 14 + 1 + 4 + 5 + 3 + 1 + 2 + 2 + 71)*1 = 119 ms

Have a Question?

Submit Here

Previous GATE Papers

Year Key Organized by
2019 Key IIT Madras
2018 Key IIT Guwahati
2017(Set1) Key IIT Roorkee
2017(Set2) Key IIT Roorkee
2016(Set1) Key IISc
2016(Set2) Key IISc
Show All