Week10 2018
Week10 2018
Lecture
In the lectures in week 10 we will nish Chapter 4 (Mutithreaded Programming). We will
start with Chapter 5 (Process Scheduling). Examples will be shown for the simulation
of Process Scheduling. Solaris process scheduling administration will be illustrated using
dispadmin.
Note, as usual, that you nd even more exercises including solutions here :
http://codex.cs.yale.edu/avi/os-book/OS9/practice-exer-dir/index.html
Prepare for the Tutorial Sessions in week 11, 2018: all exercises not discussed so far (which
includes very likely all exercises from the weekly notes in week 10). In addition:
5.1 Why is it important for the scheduler to distinguish I/O-bound programs from CPU-
bound programs?
5.2 Discuss how the following pairs of scheduling criteria con ict in certain settings.
a. CPU utilization and response time
b. Average turnaround time and maximum waiting time
c. I/O device utilization and CPU utilization
5.4 In this chapter, we discussed possible race conditions on various kernel data structures.
Most scheduling algorithms maintain a run queue, which lists processes eligible to run
on a processor. On multicore systems, there are two general options: (1) each processing
core has its own run queue, or (2) a single run queue is shared by all processing cores.
What are the advantages and disadvantages of each of these approaches?
5.5 Consider the exponential average formula used to predict the length of the next CPU
burst. What are the implications of assigning the following values to the parameters used
by the algorithm?
a. α = 0 and τ0 = 100 milliseconds
b. α = 0.99 and τ0 = 10 milliseconds
5.7 Consider the following set of processes, with the length of the CPU burst time given in
milliseconds:
Process Burst Time Priority
P1 2 2
P2 1 1
P3 8 4
P4 4 2
P5 5 3
The processes are assumed to have arrived in the order P1 , P2 , P3 , P4 , P5 all at time 0.
DM510 - Operating Systems, Weekly Notes, Week 10/11, 2018
a. Draw four Gantt charts that illustrate the execution of these processes using the following
scheduling algorithms: FCFS, SJF, nonpreemptive priority (a smaller priority number
implies a higher priority), and RR (quantum = 1).
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 these scheduling algorithms?
d. Which of the algorithms results in the minimum average waiting time (over all processes)?
5.8 The following processes are being scheduled using a preemptive, round-robin scheduling
algorithm. Each process is assigned a numerical priority, with a higher number indicating
a higher relative priority. In addition to the processes listed below, the system also has
an idle task (which consumes no CPU resources and is identi ed as Pidle ). This task has
priority 0 and is scheduled whenever the system has no other availableprocesses to run.
The length of a time quantum is 10 units. If a process is preempted by a higher-priority
process, the preempted process is placed at the end of the queue.