In computer science, a scheduling algorithm is the method by which threads or processes are given access to system resources, usually processor time. This is usually done to effectively load balance a system. The need for a scheduling algorithm arrises from the requirement for most modern system to perform multitasking, or execute more than one process at a time. Scheduling algorithms are generally only used in a time slice multiplexing kernel. The reason is that in order to effectively load balance a system the kernel must be able to forceably suspend execution of threads in order to begin execution of the next thread.

The algorithm used may be as simple as Round Robin in which each process is given equal time ( for instance 1ms) in a cycling list. So that Process A executes 1ms, then process B, then process C then back to process A.

More advanced algorithms take into account process priority, or the importance of the process. This allows some processes to use more time than other processes. It should be noted that the kernel always uses whatever resources it needs to ensure proper functioning of the system, and so can be said to have infinite priority. In SMP systems, processor affinity is considered to increase overall system performance, even if it may cause a process itself to run slower. This generally improves performance by reducing cache thrashing.