Just as the operating system needs to decide the order in which I/O tasks occur on an I/O device, it also needs to decide the order in which processes run on a CPU. Such a decision is called process scheduling, and it is made by the process scheduler software of the OS. The reason that the OS needs to make this decision is that only one process can run on a single CPU at any given time.
On devices that have multiple CPUs, several programs can run in parallel (each on one CPU.)
The ultimate purposes of performing process scheduling are: