5. Operating systemsScheduling
Scheduling
Scheduling is how the operating system decides which ready thread gets a CPU next, and for how long. A machine may have a few cores but hundreds of runnable threads, so the scheduler hands out short time slices and switches fast enough that everything seems to run at once. Policies favor different goals: first-come-first-served is simple but one long job holds everyone up, round robin takes turns for responsiveness, and strict priority favors urgent work but can starve low-priority tasks unless waiting tasks slowly gain priority, a fix called aging. The same trade-offs between throughput, latency and fairness reappear in thread pools, job queues and cluster schedulers.
In this lesson: A Gantt chart with selectable algorithms, including a starvation scenario.