Sie sind auf Seite 1von 6

Operating Systems (for IT Students)

Lecture 8 Test Bank


Multiple Choice Questions

Multiple Choice Questions

1. The SJF algorithm is a special case of the


A. general priority-scheduling algorithm.
B. preemptive scheduling algorithm.
C. First-Come-First-Served algorithm.
D. CPU burst cycle condition.

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.

7. SJF is considered as a special case of priority scheduling. In the case


A. the larger the CPU burst, the lower the priority, and vice versa.
B. the smaller the CPU burst, the higher the priority, and vice versa.
C. we still need to indicate what is the priority for each process.
D. the algorithm will function as FCFS.

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.

9. A major problem with priority scheduling algorithms is


A. the average waiting time is often quite long.
B. indefinite blocking.
C. to know the length of the next CPU request.
D. All the above.

10. The problem of starvation is a disadvantage of the _________________ scheduling algorithm.


A. FCFS
B. Preemptive SJF
C. Non-Preemptive SJF
D. 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.

14. A solution to the problem of indefinite blockage of low-priority processes is ______________.


A. preemption.
B. using FCFS for same priority processes.
C. aggregation.
D. aging.

15. Aging is a technique of


A. gradually increasing the priority of processes that wait in the system for a long time.
B. gradually decreasing the priority of processes that wait in the system.
C. using starvation to solve the problem aging.
D. using indefinite blocking for all processes.

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

19. The RR scheduling algorithm stands for _________________________.


A. Round Roben.
B. Robin Round.
C. Round Reben.
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:

1: A 5: B 9: B 13: A 17: A 21: C 25: B 29: B


2: C 6: C 10: D 14: D 18: D 22: C 26: A 30: D
3: B 7: A 11: D 15: A 19: D 23: B 27: B 31: B
4: C 8: D 12: B 16: B 20: A 24: A 28: D 32: A

4
Operating Systems (for IT Students)
Lecture 8 Test Bank
Multiple Choice Questions

Extra Scheduling Examples

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

Average Waiting Time =


[Waiting Time P1 + Waiting Time P2+ Waiting Time P3+ Waiting Time P4]/4

Waiting Time for a process = Last start run time – arrival time – already run time

Average Waiting Time =


[ (4-0-1) + (1-1) + (9-2) + (17-3) ] / 4 = 6 ms

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.

P2 exit P1 exit P4 exit

P1 P2 P3 P4 P1 P3 P4 P3

0 3 6 9 12 15 18 19 21

Average Waiting Time =


[Waiting Time P1 + Waiting Time P2+ Waiting Time P3+ Waiting Time P4]/4

Waiting Time for a process = Last start run time – arrival time – already run time

Average Waiting Time =


[ (12-0-3) + (3-1) + (19-2-6) + (18-3-3) ] / 4 = 8.5 ms

Das könnte Ihnen auch gefallen