P

PrepStack

CPU Scheduling

A computer has more programs waiting to run than it has CPU cores (the parts that run instructions). CPU scheduling is the operating system's rule for deciding which waiting program gets the CPU next, and for how long. Questions in this area cover the algorithms (first come first served, shortest job first, round robin, priority) and their weak points: the convoy effect (short jobs stuck behind a long one), starvation (a job never gets its turn) and the time quantum (the slice of CPU time each job gets). After this section you can work out waiting time on paper and compare the algorithms. Job times in the examples are made up.

Topics in this section