Operating System | Gate-2017| Previous year question|Set-4

Set-15 Operating System Questions

1. Threads of a process share : [GATE – 2017]

a. global variables but not heap.
b. heap but not global variables.
c. neither global variables nor heap.
d. both heap and global variables.

Answer : d)


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

ProcessArrival TimeBurst Time
P107
P233
P355
P462

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. [GATE – 2017]

a. 3
b. 4
c. 5
d. 6

Answer : a)


3. A multithreaded program P executes with x number of threads and used 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: [GATE – 2017]

a. x = 1, y = 2
b. x = 2, y = 1
c. x = 2, y = 2
d. x = 1, y = 1

Answer : d)


4. Recall that Belady’s anomaly is that the page-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 suffers from Belady’s anomaly

Which of the following is CORRECT? [GATE – 2017]

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

Answer : b)


5. Which of the following is/are shared by all the threads in a process? [GATE – 2017]

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

a. I and II only
b. III and IV only
c. III only
d. IV only

Answer : c)


6. In a file allocation system, which of the following allocation scheme(s) can be used if no external fragmentation is allowed? [GATE – 2017]

I. Contiguous
II. Linked
III. Indexed

a. I and III only
b. II and III only
c. II only
d. III only

Answer : b)
Operating System | Gate-2017|


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

ProcessCurrent AllocationMaximum Requirement
P137
P216
P335

Which of the following best describe current state of the system? [GATE – 2017]

a. Safe, Deadlocked
b. Not Safe, Deadlocked
c. Safe, Not Deadlocked
d. Not Safe, Not Deadlocked

Answer : c)
Operating System | Gate-2017|


8. Consider the set of processes with arrival time (in milliseconds), CPU burst time (in milliseconds), and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.

ProcessArrival TimeBurst TimePriority
P10112
P25280
P31223
P42101
P59164

The average waiting time (in milliseconds) of all the processes using preemptive priority scheduling algorithm is __________. [GATE – 2017]

a. 29
b. 30
c. 31
d. 32

Answer : a)


Back to GATE-HOME


Spread the love

Leave a Comment

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