Operating Systems (For IT Students) Lecture 8 Test Bank Multiple Choice Questions
Operating Systems (For IT Students) Lecture 8 Test Bank Multiple Choice Questions
2. In priority scheduling algorithm, a priority is associated with each process, and the CPU is allocated to the process with
the ___________ priority.
A. shortest.
B. longest.
C. highest.
D. lowest.
3. In SJF/priority scheduling, if processes have equal CPU bursts/priorities, then there are scheduled
A. based on their PCBs.
B. in FCFS order.
C. according to the user requirements.
D. randomly.
4. The SJF algorithm is considered a priority algorithm where the priority (p) is the
A. sum of next CPU bursts to calculate the waiting time as a priority.
B. same as the next CPU burst.
C. inverse of the next CPU burst.
D. inverse of the next I/O burst.
5. We have four processes P1, P2, P3, P4, with CPU burst 3, 7, 9, 1 respectively. If non-preemptive SJF is used as a
scheduling algorithm then the order will according to the
A. CPU burst from largest to smallest: 9, 7, 3, 1
B. CPU burst from smallest to largest: 1, 3, 7, 9
C. Inverse of CPU burst, from largest to smallest: 1/1, 1/3, 1/7, 1/9
D. Inverse of CPU burst, from smallest to largest: 1/9, 1/7, 1/3, 1/1.
6. We have four processes P1, P2, P3, P4, with CPU burst 3, 7, 9, 1 respectively. If SJF is used as a scheduling
algorithm, considering it as a special case from priority scheduling, then the order will according to the
A. CPU burst from largest to smallest: 9, 7, 3, 1
B. CPU burst from smallest to largest: 1, 3, 7, 9
C. Inverse of CPU burst, from largest to smallest: 1/1, 1/3, 1/7, 1/9
D. Inverse of CPU burst, from smallest to largest: 1/9, 1/7, 1/3, 1/1.
8. In terms of designing priority scheduling priorities are indicated by some fixed range of numbers. In such representation
A. the number 0 represent the highest priority.
B. the number 0 represent the lowest priority.
C. the user can decide if 0 is the highest or the lowest priority.
D. there is no general agreement on whether 0 is the highest or lowest priority.
1
Operating Systems (for IT Students)
Lecture 8 Test Bank
Multiple Choice Questions
11. The priority scheduling algorithm suffers from the ________________ problem.
A. process control blocking.
B. definite blocking.
C. saturation.
D. None of the above.
12. The starvation problem of the priority scheduling algorithm can cause
A. the average waiting time to be quite long.
B. leaving some low- priority processes waiting indefinitely.
C. difficulty in knowing the length of the next CPU request.
D. All the above.
13. The indefinite blocking problem in heavily loaded computer system will result in
A. higher-priority processes preventing low-priority process from ever getting the CPU.
B. the PCB to be unordered causing blocking to the system.
C. blocking users from using the resources.
D. All the above.
16. Aging was implemented for a priority-scheduling algorithm having priorities range of 127 (low) to 0 (high). The waiting
processes P1, P2, P3, P4 and P5 have the initial priority values 100, 90, 40, 15 and 3 respectively. Aging was
implemented to increase each waiting process by 5. What will be the resultant values?
A. 105, 95, 45, 20, 8.
B. 95, 85, 35, 10, 0.
C. 95, 85, 35, 10, -2.
D. None of the above.
17. Aging was implemented for a priority-scheduling algorithm having priorities range of 0(low) to 127(high). The waiting
processes P1, P2, P3, P4 and P5 have the initial priority values 100, 90, 40, 15 and 3 respectively. Aging was
implemented to increase each waiting process by 5. What will be the resultant values?
A. 105, 95, 45, 20, 8.
B. 95, 85, 35, 10, 0.
C. 95, 85, 35, 10, -2.
D. None of the above.
18. The ________________ scheduling algorithm is designed especially for time- sharing systems.
A. priority
B. FCFS
C. preemptive SJF
D. round-robin
20. The RR scheduling algorithm is similar to _________ scheduling, but ________ is added to enable the system to
switch between processes.
A. FCFS, preemptive.
B. SJF, timer.
C. priority, scheduler dispatch.
D. ready queue, control.
2
Operating Systems (for IT Students)
Lecture 8 Test Bank
Multiple Choice Questions
21. In the RR algorithm, a small unit of time, called a _________________ must be defined.
A. timer quanta.
B. time slide.
C. time quantum.
D. quantum slide.
22. In the RR algorithm, a small unit of time, called a _________________ must be defined.
A. timer quanta.
B. time slide.
C. time slice.
D. quantum slide.
23. In the RR algorithm, the ready queue is treated as a______________ and the CPU scheduler goes around the ready
queue, allocating the CPU to each process based on the ________________.
A. linked list, scheduler.
B. circular queue, time quantum.
C. random queue, dispatcher.
D. data structure, PCB.
24. In RR scheduling, it is common to select the unit of _____ for the time quantum.
A. one.
B. two.
C. three.
D. more.
25. When using the RR scheduling algorithm, the CPU scheduler picks the _____ process from the ready queue, sets a
timer to ________ after 1 time quantum, and ________ the process.
A. last, dispatch, execute.
B. first, interrupt, dispatch.
C. last, stop, admit.
D. first, run, schedule.
26. When RR scheduling is used and a process is picked from the ready queue, if the process has a CPU burst less than
the time quantum then
A. the process itself will release the CPU voluntarily.
B. the OS will interrupt the process.
C. the process will go into waiting state.
D. the OS must execute a context switch.
27. When RR scheduling is used and a process is picked from the ready queue, if the process has a CPU burst larger than
the time quantum then
A. the process itself will release the CPU voluntarily.
B. the OS will interrupt the process and a context switch will take place.
C. the process will go into waiting state.
D. the OS must execute a context switch.
28. When RR scheduling is used and a process is picked from the ready queue, if the process has a CPU burst larger than
the time quantum then the OS
A. will interrupt the process.
B. will put at the tail of the ready queue.
C. must execute a context switch to pick up the next process.
D. All the above.
29. In the RR scheduling algorithm, no process is allocated the CPU for more than one time quantum in a row unless it
_____________________.
A. asks the OS for more time.
B. is the only runnable process.
C. disables the interrupt and the OS will run as non-preemptive.
D. the system has many processes waiting in the ready queue.
3
Operating Systems (for IT Students)
Lecture 8 Test Bank
Multiple Choice Questions
30. In designing the RR scheduling algorithm, the time quantum must be _______with respect to the
_______________time.
A. small, process run.
B. large, CPU.
C. small, context-switch.
D. large, context-switch.
31. In designing the RR scheduling algorithm, the time required by the OS to do ______________ must be considered in
setting the value of the time quantum.
A. process run.
B. context-switch.
C. ready queue.
D. CPU burst.
32. In RR scheduling, if the time quantum is too large, then RR scheduling will behave like the _____________.
A. FCFS algorithm.
B. priority algorithm.
C. preemptive SJF.
D. non-preemptive SJF.
Keys:
4
Operating Systems (for IT Students)
Lecture 8 Test Bank
Multiple Choice Questions
Priority Scheduling
CPU Burst
Process Arrival Time Priority
Time
P1 0 6 2
P2 1 3 1
P3 2 8 3
P4 3 4 4
All timings are in milliseconds (ms)
Priority column is used considering the arrival time. The Priority Scheduling Algorithm is a preemptive one. So
at time 0 and since only P1 was in the ready queue, the scheduler will pick P1 and start running it. By time 1,
P2 arrives to the ready queue having higher priority. So the scheduler will preempt P1 and pick up P2. After P2
will exit at time 4, the ready queue will contain the new added processes P3 AND P4. P1 will continue running
since it has a higher priority than the others. The rest will be sorted based on priority.
P1 P2 P1 P3 P4
01 4 9 17 21
Waiting Time for a process = Last start run time – arrival time – already run time
5
Operating Systems (for IT Students)
Lecture 8 Test Bank
Multiple Choice Questions
RR Scheduling
CPU Burst
Process Arrival Time Priority
Time
P1 0 6 2
P2 1 3 1
P3 2 8 3
P4 3 4 4
All timings are in milliseconds (ms)
Assume that the Time Quantum q = 3. Priority column is not used but the arrival time is considered as the
sequence of processes.
P1 P2 P3 P4 P1 P3 P4 P3
0 3 6 9 12 15 18 19 21
Waiting Time for a process = Last start run time – arrival time – already run time