(Usage hints for this presentation)
IT Systems, Summer Term 2024
Dr. Jens Lechtenbörger (License Information)
(Based on Chapter 3 of (Hailperin 2019))
CPU scheduling
Figure © 2016 Julia Evans, all rights reserved; from julia's drawings. Displayed here with personal permission.
Scheduling (planning) and dispatching (allocation) of CPU via OS
Non-preemptive, e.g., FIFO scheduling
Preemptive, e.g., Round Robin scheduling
(Similar decisions in operations management)
Figure 3.3 of cite:Hai17
Figure by Max Hailperin under CC BY-SA 3.0; converted from GitHub
Families of schedulers
Dynamically adjusted thread priorities
Controlling proportional shares of processing time
For scheduling with pen and paper, you need to know arrival times and service times for threads
OS does not know either ahead of time
Use fixed, numerical priority per thread
Implementation alternatives
Subsequent examples: FIFO and Round Robin
Beware!
Key ingredients
Scheduling when (1) timer interrupt triggered or (2) thread ends, yields, or is blocked
Timer interrupt: Preempt running thread
Thread ends, yields, or is blocked
This task is available for self-study in Learnweb.
Perform Round Robin scheduling given the following situation:
q=4 | Thread | Arrival Time | Service Time |
---|---|---|---|
T1 | 0 | 3 | |
T2 | 1 | 6 | |
T3 | 4 | 3 | |
T4 | 9 | 6 | |
T5 | 10 | 2 |
Source files are available on GitLab (check out embedded submodules) under free licenses. Icons of custom controls are by @fontawesome, released under CC BY 4.0.
Except where otherwise noted, the work “Scheduling”, © 2017-2024 Jens Lechtenbörger, is published under the Creative Commons license CC BY-SA 4.0.