Scheduling (computing)

Scheduled tasks can also be distributed to remote devices across a network and managed through an administrative back end.

On the other hand, if all processes are CPU-bound, the I/O waiting queue will almost always be empty, devices will go unused, and again the system will be unbalanced.

In modern operating systems, this is used to make sure that real-time processes get enough CPU time to finish their tasks.

For example, in concurrent systems, coscheduling of interacting processes is often required to prevent them from blocking due to waiting on each other.

The specific heuristic algorithm used by an operating system to accept or reject new tasks is the admission control mechanism.

[8] The medium-term scheduler temporarily removes processes from main memory and places them in secondary memory (such as a hard disk drive) or vice versa, which is commonly referred to as swapping out or swapping in (also incorrectly as paging out or paging in).

In many systems today (those that support mapping virtual address space to secondary storage other than the swap file), the medium-term scheduler may actually perform the role of the long-term scheduler, by treating binaries as swapped-out processes upon their execution.

The short-term scheduler (also known as the CPU scheduler) decides which of the ready, in-memory processes is to be executed (allocated a CPU) after a clock interrupt, an I/O interrupt, an operating system call or another form of signal.

Another component that is involved in the CPU-scheduling function is the dispatcher, which is the module that gives control of the CPU to the process selected by the short-term scheduler.

Scheduling disciplines are used in routers (to handle packet traffic) as well as in operating systems (to share CPU time among both threads and processes), disk drives (I/O scheduling), printers (print spooler), most embedded systems, etc.

Scheduling deals with the problem of deciding which of the outstanding requests is to be allocated resources.

In packet-switched computer networks and other statistical multiplexing, the notion of a scheduling algorithm is used as an alternative to first-come first-served queuing of data packets.

If differentiated or guaranteed quality of service is offered, as opposed to best-effort communication, weighted fair queuing may be utilized.

In even more advanced systems such as LTE, the scheduling is combined by channel-dependent packet-by-packet dynamic channel allocation, or by assigning OFDMA multi-carriers or other frequency-domain equalization components to the users that best can utilize them.

Earliest deadline first (EDF) or least time to go is a dynamic scheduling algorithm used in real-time operating systems to place processes in a priority queue.

Sometimes the kernel is divided in three or more parts: Manual scheduling, preemptive and interrupt level.

For example, Windows NT/XP/Vista uses a multilevel feedback queue, a combination of fixed-priority preemptive scheduling, round-robin, and first in, first out algorithms.

In this system, threads can dynamically increase or decrease in priority depending on if it has been serviced already, or if it has been waiting extensively.

Every priority level is represented by its own queue, with round-robin scheduling among the high-priority threads and FIFO among the lower-priority ones.

The kernel always uses whatever resources it needs to ensure proper functioning of the system, and so can be said to have infinite priority.

The differences were such that the variants were often considered three different operating systems: Later virtual storage versions of MVS added a Workload Manager feature to the scheduler, which schedules processor resources according to an elaborate scheme defined by the installation.

Very early MS-DOS and Microsoft Windows systems were non-multitasking, and as such did not feature a scheduler.

It relied on the program to end or tell the OS that it didn't need the processor so that it could move on to another process.

Windows 95 introduced a rudimentary preemptive scheduler; however, for legacy support opted to let 16-bit applications run without preemption.

[12] Vista also uses a priority scheduler for the I/O queue so that disk defragmenters and other such programs do not interfere with foreground operations.

Linux 2.2 added scheduling classes and support for symmetric multiprocessing (SMP).

[18] CFS is the first implementation of a fair queuing process scheduler widely used in a general-purpose operating system.

[19] The CFS uses a well-studied, classic scheduling algorithm called fair queuing originally invented for packet networks.

The Brain Fuck Scheduler, also created by Con Kolivas, is an alternative to the CFS.

Unlike Linux,[25] when a process is done using its time quantum, it is given a new priority and put back in the queue.

A sample thread pool (green boxes) with a queue (FIFO) of waiting tasks (blue) and a queue of completed tasks (yellow)
A highly simplified structure of the Linux kernel, which includes process schedulers, I/O schedulers, and packet schedulers