CS111: Lecture 7 Scribe Notes

Scheduling Algorithms

October 21, 2013

Created By: Jose Vega

Scheduling

First, we focus on the scheduling mechanism.

The image shows sample code for a yoelding loop
Note that yield is relatively expensive compared to sum ^= i;. While this code will allow us to schedule other processes the way we want, it's slowing down our loop. Instead, we will yield every once in a while:

The image shows modified sample code

Polling Versus Busy Waiting

The image compares polling and busy waiting code

What we would like

Problem

We want an approach that doesn't assume cooperation

Does preemptive scheduling solve infinitely looping code?

Scheduling Policy

Sample Issues

Real Time Scheduling

Scheduling Metrics

Simple fair example

Priority - Based Scheduling