What is multitasking programming

(Eng. Ā»multi-program processingĀ«, parallel processing, multi-programming, multi-process operation),

Today's computers no longer run one program alone, but many at the same time. Quite often you have several program windows open at the same time. There are also many programs that belong to the operating system and run without a desktop window. Organizing this apparent simultaneity is one of the core tasks of the operating system. The keyword here is multitasking. You can find out here how it works and why some systems do better (Linux, Windows XP, MacOS X) and others less well (Windows 95/98 / ME).

What is multitasking?

Multitasking is the ability of an operating system to execute several tasks, i.e. several application programs or parts of application programs, in parallel. A program runs in the foreground (foreground processing), i. This means that entries can be made and output is shown on the screen, the others (the background tasks) run in the background. However, if you look closely, the programs do not actually run simultaneously, even if it appears that way from the outside. In reality, the resources of the processor are used alternately by the individual applications, each time only for a fraction of a second. The current intermediate status of a program is temporarily stored after each access, so that it is possible to continue calculating exactly at this point when this program is "next in line".
Depending on how the computing time is distributed among the applications, a distinction is made between cooperative and preemptive multitasking.

With cooperative multitasking (also called non-preemptive multitasking) the operating system does not have full control over how the resources are allocated to the individual application programs. Put simply, each program determines how quickly it returns control to the operating system. However, this method has a serious disadvantage: If a program does not release the computer's resources, e.g. B. due to a program error, the whole system collapses. A crash occurs in which all programs are aborted. Cooperative multitasking is implemented in all Windows versions based on DOS (Windows 3.x, 9x, ME) as well as with the Macintosh operating systems up to Mac OS 9.1.

With preemptive multitasking (also preemptive multitasking) the operating system always has full control over the release of resources. Here it alternately assigns a short period of time (a time slice) to each application program. If a program is now defective, it can crash, but the other applications are not affected and continue to run undisturbed. As a further advantage, this method offers the possibility of assigning different priorities to the individual applications. A program with a high priority is then allocated more time slots than a program with a lower priority. Most operating systems, including Windows NT, Windows XP, Mac OS X, Unix, Linux, and OS / 2, use preemptive multitasking.
In Windows 2000 / XP you can display the list of all active programs in the Task Manager (CTRL + ALT + DEL => Task Manager) and terminate individual applications in a targeted manner.
There are similar tools in Linux and MacOS X.