Agenda
<aside> ๐ Reminders
As weโve seen before, the OS needs to manage several threads that are each vying for the CPU, its needs some way to manage which thread to run, and for how long a thread should hold the CPU (this is called a time quantum).
<aside> ๐ก
Time Quantum: The shortest period of time a process is allowed to occupy the CPU
</aside>
In lecture, you will discuss several ways to measure performance of a scheduling algorithm, one thing to note is that any decent scheduling algorithm must prevent thread starvation.
<aside> ๐ก
Starvation: The phenomenon in which a thread/process is prevented from ever running due to the schedulerโs choices
</aside>
Below is a summary of common scheduling algorithms along with their strengths and weaknesses. We discuss the notable algorithms in more detail in the next sections.
Not all threads are created equal, some have far more important goals to accomplish than others (you wouldnโt want a thread updating your clock to be prioritized over one handling your lane assist in your carโs software). For this reason, threads are usually associated with a priority (see struct thread) and, as the name suggests, higher priority threads are given priority to run.
The multi-level feedback queue resolves both of these issues.
You will implement priority scheduling in P1. There are three main requirements for this section: