Operating System GATE CS and IT previous year questions with Answer


Ques 21 Gate 2017 Set-2


The read access times and the hit ratios for different caches in a memory hierarchy are as given below:

Cache Read Access Time
(In Nanosecond)
Hit Ratio
I-Cache 2 0.8
D-Cache 2 0.9
L2-Cache 8 0.9

The read access time of main memory in 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the writeback policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% od memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is _________


a is the correct answer.


Ques 22 Gate 2017 Set-2


A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for 3 processes are shown below:

Process Allocation Time Maximum Requirement
P1 3 7
P2 1 6
P3 3 5

Which of the following best describes the current state of the system?

A

Safe, Deadlocked

B

Safe, Not Deadlocked

C

Not Safe, Deadlocked

D

Not Safe, Not Deadlocked



Ques 23 Gate 2017 Set-2


Which of the following is/are shared by all the threads in a process?

I. Program Counter
II. Stack
III. Address space
IV. Registers

A

III only

B

IV only

C

I and II only

D

III and IV only



Ques 24 Gate 2017 Set-1


Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:

Process Arrival Time Brust Time
P1 0 7
P2 3 3
P3 5 5
P4 6 2


If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _______ milliseconds.


a is the correct answer.


Ques 25 Gate 2017 Set-1


Recall that Belady’s anomaly is that the pages-fault rate may increase as the number of allocated frames increases. Now consider the following statements:

S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady’s anomaly.
S2: LRU page replacement algorithm suffer from Belady’s anomaly .


Which of the following is CORRECT?

A

S1 is true, S2 is true

B

S1 is true, S2 is false

C

S1 is false , S2 is true

D

S1 is false, S2 is false



Ques 26 Gate 2017 Set-1


A multithreaded program P executes with x number of threads and uses y number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock l, then it cannot re-acquire lock l without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of x and the minimum value of y together for which execution of P can result in a deadlock are:

A

x = 1, y = 2

B

x = 2, y = 1

C

x = 2, y = 2

D

x = 1, y = 1



Ques 27 Gate 2017 Set-1


Threads of a process share

A

global variables but not heap

B

heap but not global variables.

C

neither global variables nor heap.

D

both heap and global variables.



Ques 28 Gate 2016 Set-2


Consider a non-negative counting semaphore S. The operation P(S) decrements S, and V(S) increments S. During an execution, 20 P(S) operations and 12 V(S) operations are issued in some order. The largest initial value of S for which at least one P(S) operation will remain blocked is ________.


a is the correct answer.


Ques 29 Gate 2016 Set-2


Consider the following processes, with the arrival time and the length of the CPU burst given in milliseconds. The scheduling algorithm used is preemptive shortest remaining-time first.

Process Arrival Time Burst Time
P1 0 10
P2 3 6
P3 7 1
P3 8 3

The average turn around time of these processes is ___________ milliseconds.


a is the correct answer.


Ques 30 Gate 2016 Set-2


Consider the following two-process synchronization solution.

Process 0
---------
Entry: loop while (turn == 1);
(critical section)
Exit: turn = 1;

Process 1
----------
Entry: loop while (turn == 0);
(critical section)
Exit: turn = 0;

The shared variable turn is initialized to zero. Which one of the following is TRUE?

A

This is a correct two-process synchronization solution.

B

This solution violates mutual exclusion requirement.

C

This solution violates progress requirement.

D

This solution violates bounded wait requirement.