Operating Systems Test 3: Number of Questions: 25 Section Marks: 30
Operating Systems Test 3: Number of Questions: 25 Section Marks: 30
Directions for questions 1 to 25: Select the correct alterna- (A) 15 (B) 13
tive from the given choices. (C) 8 (D) 3
1. Round Robin scheduling with large time slice behaves 6. As the time quantum increases for Round Robin sched-
as: uling, generally the average waiting time:
(A) FCFS (A) Increases
(B) Priority based scheduling (B) Decreases
(C) Multi-level queue scheduling (C) Unchanged
(D) Preemptive SJF (D) Cannot be determined
2. Priority inversion means: 7. Consider three processes P0, P1, P2 arrived at Time 0,
(A) Shortest Job waits for longest job with the burst times x, y, z respectively. x < z < y. What
(B) High priority process waits for low priority pro- is the average waiting, if SJF is used for scheduling?
cess x+y+z x+z
(A) (B)
(C) Longest job waits for shortest job 2 3
(D) both (A) and (C). 2x + z x+z+y
(C) (D)
3. Consider the following table with 4 processes: 3 3
If Longest Remaining Time scheduling (Preemptive What is average waiting time of processes which have
longest Job First) is used, then the average turnaround taken more than one slot for completion, When SRTF
time is _____. is used for scheduling?
(A) 11 (B) 12 (A) 2.66 (B) 3.0
(C) 13 (D) 14 (C) 4.0 (D) 3.33
4. Consider the following table: 9. Match the following:
List 1 List 2
Process Arrival Time Burst Time
(a) Ready → Running 1. Dispatching
P0 0 4
(b) Running → Waiting 2. Preemption
P1 1 3
(c) Waiting → Ready 3 Completion
P2 1 3
(d) Running → Terminate 4. I/O Request
P3 2 5
(e) Running → Ready 5 Event occurred
If Longest Job First scheduling is used then the average
waiting time is _____. a b c d e
(A) 5.00 (B) 5.25 (A) 1 2 3 4 5
(C) 5.50 (D) 5.75 (B) 1 4 5 3 2
(C) 1 4 2 3 5
5. Consider the following table: (D) 1 2 5 4 3
Process Arrival Time Turn around Time 10. Consider the following:
P0 0 15
Process Arrival Time Burst Time
P1 0 2
A 0 4
P2 0 18
B 1 6
P3 0 20
C 5 3
P4 0 7
D 7 2
If priority scheduling is used for scheduling, what is the What is the waiting time of process D, if FIFO schedul-
burst time of process Po? ing is used?
Operating Systems Test 3 | 3.179
P. Starvation 1. FCFS P4
Q. Ageing 2. Round Robin
R. Context switching 3. Preemptive Priority
Which of the following dead lock cycle occurs in the
overhead
given graph?
(A) P2 → P3 → P2 (B) P2 → P1 → P4 → P2
S. Batch processing 4. Highest Response Ratio next
(C) Both (A) and (B) (D) None of the above
P Q R S 20. A counting semaphore has a value—a at a certain time,
(A) 1 4 2 3 it represents:
(B) 4 1 3 2 (A) ‘a’ number of processes waiting
(C) 3 4 2 1 (B) ‘a’ number of process in critical section
(D) 1 4 3 2 (C) Either (A) or (B)
16. Consider a system with four processes A, B, C and D (D) None, negative values are not allowed on Count-
and ‘m’ instances of resource ‘r’. The resource require- ing semaphore
ments are 5, 7, 3 and 4 instances of resource ‘r’ respec- 21. Semaphores _____.
tively. What is the minimum value of ‘m’, hence system (A) are process synchronization tools to avoid dead-
is dead lock free? lock.
3.180 | Operating Systems Test 3
(B) are process synchronization tools to avoid race Consider the following code segments:
condition. I. wait (s1); wait (s2);
(C) uses Test And Set for synchronization. II. wait (s2); wait (s1);
(D) All the above III. signal (s1); signal (s2);
22. The system is running with 5 processes. Consider the IV. signal (s2); signal (s1);
following code segments for synchronization: Which of the following may lead to deadlock?
process 1: X Y W Z
while(1) (A) I III II IV
{ (B) I III I III
signal (mutex);
(C) II IV II IV
<Critical Section; >
(D) I III I IV
signal (mutex);
} 24. Consider the following snapshot of a system:
Process i where i = 2,3,4,5.
Max Allocation
while (1)
{ Process R1 R2 R3 R1 R2 R3
wait (mutex); a 3 2 4 1 1 1
< Critical Section > b 5 5 2 2 3 2
signal (mutex); c 4 4 3 3 1 1
} d 3 4 4 1 0 1
‘mutex’ is a binary semaphore.
Atmost how many processes can enter into the critical Available = {5, 3, 2}
section? Which of the following is not a safe sequence?
(A) 1 (B) 2 (A) a b c d (B) b c d a
(C) 3 (D) 5 (C) b a c d (D) c a d b
23. Let P0 and P1 are two processes, each accesses two 25. In the above system, if process ‘A’ requests for {0, 1, 2}
binary semaphores s1 and s2 to enter critical section. resources and if the request is granted, then the system
s1 and s2 are initialized to 1. state is _____.
P0: P1: (A) safe state
X; W; (B) unsafe state
<critical section> <critical section> (C) deadlock
Y; Z; (D) either (B) or (C)
Answer Keys
1. A 2. B 3. A 4. B 5. C 6. A 7. C 8. C 9. B 10. C
11. D 12. A 13. C 14. B 15. C 16. B 17. A 18. C 19. D 20. A
21. B 22. D 23. A 24. A 25. A