COMP 3430 Operating Systems
Scheduling part 1
February 16th, 2022
Copyright By PowCoder代写 加微信 powcoder
By the end of today’s lecture (and readings), you should be able to:
▶ Compare and contrast preemptive and non-preemptive (cooperative) multitasking.
▶ Compare and contrast different scheduling policies.
The Rocket Book (Public Domain)
Scheduling
How are we supposed to schedule that? (Pixabay License)
▶ Processes have a lifecycle. ▶ They have states.
▶ We’ve got all these processes/threads talking to each other.
▶ Scheduling: decide which one should use resources next.
Scheduling goals
Schedulers have different (often competing) goals.
▶ Minimizing turnaround time 𝑇completion − 𝑇arrival
▶ Maximizing throughput (get as much work done as possible)
▶ Being fair to all work that needs to be done (nobody is
starved of access to resources)
▶ Minimizing response time 𝑇firstrun − 𝑇arrival
Yes, the gears of an OS. (Pixabay License)
Two main parts to the scheduling parts of an OS.
1. The scheduler (an oracle that decides which job goes next)
2. The dispatcher (the machine that actually switches to that job)
Design question: Why are these two separate things?
Let’s have a quiz on scheduling.
Spin the wheel? (Pixabay License)
What could the kernel be doing?
▶ strace… didn’t exactly work for us last time (mkfifo).
▶ Poll: Could we trace any system call and arrive at the scheduler?
▶ What keywords could we search for to find the scheduler?
Sleeping? (Public Domain)
▶ Scheduling
▶ We can measure (and compare) the performance of scheduling
algorithms.
▶ Some scheduling algorithms rely on unrealistic assumptions.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com