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:
Process | Arrival Time | Burst 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. [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:
Process | Current Allocation | Maximum Requirement |
P1 | 3 | 7 |
P2 | 1 | 6 |
P3 | 3 | 5 |
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.
Process | Arrival Time | Burst Time | Priority |
P1 | 0 | 11 | 2 |
P2 | 5 | 28 | 0 |
P3 | 12 | 2 | 3 |
P4 | 2 | 10 | 1 |
P5 | 9 | 16 | 4 |
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)