Operating Systems 2014F: Tutorial 3

From Soma-notes

In this tutorial you will be playing with the scheduling simulators from the textbook. Please do as many of the following homework exercises as you can during the tutorial time. Note that you should expect to do simple scheduling calculations on the midterm, so now is your time to learn how to do them.

The scheduling simulators are all Python programs that can be run from the Linux command line (or other Python execution environment). There is a README accompanying each that explains how to run them, but the basic idea is that you can run them to create a scheduling problem and then (with the "-c" option) they give the solution to problem - thus you can check whether your answers are right!

The Python code and links to associated chapters are on the textbook's homework page.

Chapter 7, Scheduling Introduction

For these questions use scheduler.py (type "tar xzf HW-Scheduler.tgz" to extract).

  1. Compute the response time and turnaround time when running three jobs of length 200 with the SJF and FIFO schedulers.
  2. Now do the same but with jobs of different lengths: 100, 200, and 300.
  3. Now do the same, but also with the RR scheduler and a time-slice of 1.
  4. For what types of workloads does SJF deliver the same turnaround times as FIFO?
  5. For what types of workloads and quantum lengths does SJF deliver the same response times as RR?
  6. What happens to response time with SJF as job lengths increase? Can you use the simulator to demonstrate the trend?
  7. What happens to response time with RR as quantum lengths increase? Can you write an equation that gives the worst-case response time, given N jobs?