Microsoft Store
 

Computer multitasking


 

In computing, multitasking is a method by which multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running at any point in time, meaning that the CPU is actively executing instructions for that task.

Related Topics:
Processes - CPU

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Multitasking solves the problem by scheduling which task may be the one running at any given time, and when another waiting task gets a turn. The act of reassigning a CPU from one task to another one is called a context switch.

Related Topics:
Scheduling - Context switch

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

When context switches occur frequently enough the illusion of parallelism is achieved.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Even on computers with more than one CPU (called multiprocessor machines), multitasking allows many more tasks to be run than there are CPUs.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

Operating systems may adopt one of many different scheduling strategies, which generally fall into the following categories:

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

  • In multiprogramming systems, the running task keeps running until it performs an operation that requires waiting for an external event (e.g. reading from a tape). Multiprogramming systems are designed to maximize CPU usage.
  • In time-sharing systems, the running task is required to relinquish the CPU, either voluntarily or by an external event such as a hardware interrupt. Time sharing systems are designed to allow several programs to execute apparently simultaneously.
  • In real-time systems, some waiting tasks are guaranteed to be given the CPU when an external event occurs. Real time systems are designed to control mechanical devices such as industrial robots, which require timely processing.
  • Nowadays, the term time-sharing is seldom used, being replaced by simply multitasking.

    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~