Professional Researcher's Encyclopaedia

Knowledge is only a click away

Computer multitasking - enyclopaedia article

Computer multitasking

Summary: In computing, multitasking is a method by which multiple tasks may execute, apparently simultaneously, on a single computer processor. Multitasking on a single CPU is accomplished by rapidly alternating between several active tasks, also known as processes. These alternations, called "context switches", are either voluntarily initiated by a running process, or by an external event such as a hardware interrupt. The first efforts to create multitasking systems took place in the 1960s, although ...

read the full Computer multitasking article

Buy Computer multitasking related products:


Buy from Amazon.co.uk Books - Music - Classical - VHS - DVD - Video-games - Software - Electronics - Toys
Buy from Amazon.com Books - Music - Classical - VHS - DVD - Videogames - Software - Electronics - Photo - Toys
Buy from Amazon.ca Books - Music - Classical - VHS - DVD - Video-games - Software - Livres en Français
Buy from Amazon.de - - - - - - -
Buy from Amazon.fr - - - - -
Advanced Product Search (new):    uk    |     us    |     ca    |     de    |     fr

Computer multitasking

     From Wikipedia, the free encyclopedia.

In computing, multitasking is a method by which multiple tasks may execute, apparently simultaneously, on a single computer processor. Multitasking on a single CPU is accomplished by rapidly alternating between several active tasks, also known as processes. These alternations, called "context switches", are either voluntarily initiated by a running process, or by an external event such as a hardware interrupt.

The first efforts to create multitasking systems took place in the 1960s, although the process was then referred to as "time-sharing". The purpose of these early efforts was to allow multiple users to share a single mainframe computer, thereby extending its usefulness. The term "time-sharing", which refers specifically to the sharing of a computer by multiple users, has become essentially obsolete, in favor of the more general "multitasking".

Early multitasking systems consisted of suites of related applications that voluntarily ceded time to each other. This approach, which was eventually supported by many computer operating systems, is today known as cooperative multitasking. Although it is rarely used in larger systems, Microsoft Windows prior to Windows 95, and MacOS prior to OS X both used cooperative multitasking to enable the running of multiple applications simultaneously.

Cooperative multitasking has many shortcomings. For one, a cooperatively multitasked system must rely on each process to regularly give time to other processes on the system. A poorly designed program, or a "hung" process, can effectively bring the system to a halt. The design requirements of a cooperatively multitasked program can also be onerous for some purposes, and may result in irregular (or inefficient) use of system resources.

To remedy this situation, most time-sharing systems quickly evolved a more advanced approach known as preemptive multitasking. On a such a system, a hardware system (not included on many early machines) can "interrupt" a running process, and direct the processor to execute a different piece of code. A system designed to take advantage of this feature need not rely on the voluntary ceding of processor time by individual processes. Instead, the hardware interrupt system can be set to "preempt" a running process and give control back to the operating system software, which can later restore the preempted process at exactly the point where it was interrupted. Programs "preempted" in such a manner need not explicitly give time to other processes; as far as a programmer is concerned, software programs can be written as though granted uninterrupted access to the CPU, except for some uncertainty about exactly when the program will complete.

Preemptive multitasking allows the computer system to more reliably guarantee each process a regular "slice" of operating time. It also allows the system to rapidly deal with important external events like incoming data, which might require the immediate attention of one or another process.

At any specific time, processes can be grouped into two categories: those that are waiting for input or output (called "I/O bound"), and those that are fully utilizing the CPU ("CPU bound"). In early systems, processes would often "poll", or "busywait" while waiting for requested input (such as disk, keyboard or network input). During this time, the process was not performing useful work, but still maintained complete control of the CPU. With the advent of interrupts and preemptive multitasking, these I/O bound processes could be "sdsdblocked", or put on hold, pending the arrival of the necessary data, allowing other processes to utilize the CPU. As the arrival of the requested data would generate an interrupt, blocked processes could be guaranteed a timely return to execution.

Although multitasking techniques were originally developed to allow multiple users to share a single machine, it soon became apparent that multitasking was useful regardless of the number of users. Many operating systems, for mainframes down to single-user personal computers, have recognized the usefulness of multitasking support for a variety of reasons. Multitasking makes it possible for a single user to run multiple applications at the same time, or to run "background" processes while retaining control of the computer.

Another reason for multitasking was in the design of real-time computing systems, where a number of possibly unrelated external activities needed to be controlled by a single processor system. In such systems a hierarchical interrupt system was coupled with process prioritisation to ensure that key activities were given a greater share of available process time.

Processes that are entirely independent are not much trouble to program. Most of the complexity in multitasking systems comes from the need to share computer resources between tasks and to synchronize the operation of co-operating tasks.

Large computer systems were sometimes built with a central processor and some number of I/O processors, a kind of asymmetric multiprocessing. One use for interrupts is to allow a simpler processor to simulate the dedicated I/O processors that it did not have.

Over the years, multitasking systems have been refined. Modern operating systems generally include detailed mechanisms for prioritizing processes, while symmetric multi-processing has introduced new complexities and capabilities.

With the introduction of virtual memory it became useful to distinguish between multitasking of processes and threads. Tasks which share the same virtual memory space are called threads. Threads are described as lightweight because switching between threads does not involve changing the virtual memory context. Processes were distinguished by the fact that each had its own virtual memory space, so that it appeared to have the entire memory to itself, and could contain multiple threads running in that memory. Operating system functions are typically mapped into each virtual address space and interrupt handling typically runs in whichever memory context is in place when the interrupt occurs, so programs are still vulnerable to malfunctioning system code.

Another key innovation was the idea of privilege levels. Low privilege tasks are not allowed some kinds of memory access and are not allowed to perform certain instructions. When a task tries to perform an unprivileged operation an interrupt occurs and a supervisory program running at a higher level is allowed to decide how to respond. This created the possibility of virtualizing the entire system, including virtual peripheral devices. Such a simulation is called a virtual machine operating system. Early virtual machine systems did not have virtual memory, but both are common today.

See also:

link to this article with the following HTML

 
This article is from Wikipedia. This article was up-to-date as of 8 May 2004 - See live article
All text is available under the terms of the GNU Free Documentation License.

This page is part of Professional Researcher
Web site design by Dean Marshall