multitasking

<computer, parallel> (Or "multi-tasking", "multi-processing", "multiprogramming", "concurrency") A technique used in an operating system for sharing a single processor between several independent jobs. The first multitasking operating systems were designed in the early 1960s.

Under "cooperative multitasking" the running task decides when to give up the CPU and under "pre-emptive multitasking" the scheduler suspends the currently running task after it has run for a fixed period known as a "time-slice" and (re)starts another task.

The running task may relinquish control voluntarily even in a pre-emptive system if it is waiting for some external event. In either system a task may be suspended prematurely if a hardware interrupt occurs, especially if a higher priority task was waiting for this event and has therefore become runnable.

Multitasking introduces overheads because the processor spends some time in choosing the next job to run and in saving and restoring tasks' state, but it reduces the worst-case time from job submission to completion compared with a simple batch system where each job must finish before the next one starts. Multitasking also allows the CPU to do useful work on other tasks while some tasks are waiting for some external event.

A multitasking operating system should provide some degree of protection of one task from another so that it is not possible for tasks to interact in unexpected ways such as accidentally modifying the contents of each other's memory areas.

The jobs in a multitasking system may belong to one or many users. This is distinct from parallel processing where one user runs several tasks on several processors but closely related to time-sharing where several users run several tasks on one, or many, processors.

Multithreading is a kind of multitasking with low overheads but less protection of tasks from each other.

(22 Nov 1996)