What happens to response time with SJF as job lengths increase?

CMSC 312 Spring 2023: Sample problems for midterms
1) Prove/disprove that SJF is optimal in terms of average turnaround times of the processes.

2) For what types of workloads does SJF deliver the same turnaround times as FIFO?

3) For what types of workloads and quantum lengths does SJF deliver the same response
times as RR?

4) What happens to response time with SJF as job lengths increase?

5) What happens to response time with RR as quantum lengths increase? Explain in words
and write an equation that gives the worstcase response time, given N jobs.

6) “Preemptive schedulers are always less efficient than nonpreemptive schedulers.”
Explain how this statement can be true if you define efficiency one way and how it is
false if you define efficiency another way.

7) What is the priority inversion problem? Does this problem occur if roundrobin
scheduling is used instead of priority scheduling? Discuss.

8) Consider the following set of processes, with the length of the CPU burst time given in
milliseconds:

Process BurstTime Priority

P1 6 3

P2 1 1

P3 2 5

P4 3 4

P5 5 2

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.

(a) Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a
nonpreemptive priority (a smaller priority number implies a higher priority), and RR (quantum =
1) scheduling.

(b) What is the turnaround time of each process for each of the scheduling algorithms in part
(a)?

(c) What is the waiting time of each process for each of the scheduling algorithm s in part (a)?

(d) Which of the schedules in part (a) results in the minimal average waiting time (over all
processes)?

9) The aging algorithm with a = 1/2 is being used to predict run times. The previous four
runs, from oldest to most recent, are 40, 20, 40, and 15 msec. What is the prediction of
the next time?

10) Explain what a multilevel feedback scheduler is and why it approximates SRTF.

True or False (also give an explanation for your choice): If a user knows the length of a CPU
timeslice and can determine precisely how long his process has been running, then he can cheat
a multilevel feedback scheduler.