Homework Assignment #5


Overview

This is a sample assignment with questions about scheduling.

Solutions

Solutions are available as a plain ASCII file.


Exercise #1

Consider an OS that schedules jobs with a single Round-Robin queue. The context-switching overhead is o=0.1ms. We represent the execution timeline of a job mix on this system by indicating 1ms of computation for a job via an uppercase letter (we assume that the time quantum and all CPU bursts are integral numbers of ms). For example, the following string:

AAAoBoCoAAoDDD

means that job A executes for 3ms, then job B for 1ms, then job C for 1ms, then job A again for 2ms, then job D for 3ms, with appropriate context-switches in between. This example execution lasts 10ms + 4x0.1ms = 10.4ms (10ms of actual job execution, .4ms of context-switching overhead).

Question #1

Consider the following execution:

DDDDDDoBBBBBBoCoAAAAAAoDDDDDDoBBBoCoDDDDDDoBBBoCoDDDDDDoAAAAAAoBBBBBBoCoDDDDDDo...

Answer the following questions:

Question #2

Assume a job mix with 3 I/O-bound jobs and 1 fully CPU-bound job. The fully CPU-bound job is just one infinitely long CPU burst. Each I/O-bound job has a CPU burst of 2ms and then an I/O burst of 4ms, and repeats this burst cycle ad infinitum. The time quantum is 5ms.

We reason on steady-state execution (i.e., we consider the behavior of the workload in the long run). We assume that, initially, the ready queue contains the I/O jobs followed by the CPU job (i.e., the first time around, all I/O jobs will run before the CPU job).

Answer these questions:


Exercise #2

Consider an OS that uses an MLFQ Scheme with 3 Round-Robin Queues:

Consider a job mix in which all jobs go through sequences of CPU bursts and I/O bursts, and that all I/O bursts last 1ms (somehow, all jobs place similar, short I/O requests, to different devices). We assume that the context-switching overhead is zero (and we never show o’s in ASCII representations).

We can now describe a job by a single number: a CPU burst duration. For instance, a job with CPU burst duration of 10ms is simply: compute for 10ms, I/O for 1ms, compute for 10ms, I/O for 1ms, … ad infinitum.

We thus describe a job mix as a list of X-y notations, which means job X with CPU burst duration y. For instance, “A-5, B-9, C-3, D-1” describes a job mix with 4 jobs such that:

Question #1

Consider the following job mix: “A-6, B-2, C-9, D-7, E-10”. Answer the following questions:

Question #2

Consider the following job mix: “A-3, B-∞”. Answer the following questions: