Multitasking Systems

Jump to navigation Jump to search

Multitasking Systems are operating systems (or even system extensions) which share available processor time between multiple tasks automatically.

Types of Multitasking Systems

There are many ways multitasking can be achieved.

Cooperative Multitasking

For cooperative multitasking, a task uses the CPU until it voluntarily gives up the CPU (e.g. yields or exits). Examples of cooperative multitasking systems are pre-X MacOS, or Windows 3.x.

In some single language cooperative multitasking systems, such as Oberon and ruby, the compiler/interpreter automatically ensures that the code will periodically yield control; it allows such program to run multiple threads on operating systems such as DOS.

Preemptive Multitasking

In a preemptive multitasking system, some task switches are not caused by the currently running task voluntarily giving up the CPU, and are done for one or more reasons (including when the task consumed the time it was given and/or when a higher priority task needed the CPU).

Examples include almost all modern operating systems - e.g. Linux, *BSD, post-3.x Windows, BeOS, AmigaOS.

You can further subdivide these systems into those who can preempt tasks, and those who can preempt the kernel itself. Linux (pre-2.6 kernel) is an example of the former, while e.g. AmigaOS is an example for the latter. This is a major concern for multimedia applications or any "soft" [Real-Time Systems] because a non-preemptive kernel introduces latencies that can ruin such "near real-time" performance.

Real-Time Multitasking

In a Real-Time Operating System (RTOS), the scheduler works in a specific kind of preemptive multitasking system. It is designed for applications requiring responses within a fixed time window and tight time constraints. These systems are crucial in fields where delay can result in failure of the application.

Real-Time is defined by its determinism and high responsiveness (not always!, a RTOS can be slow as long as the task change is performed within a fixed interval), operating under strict timing constraints to ensure predictable operation and rapid task switching. It is crucial for applications that cannot tolerate delays, such as avionics and aerospace systems, embedded medical devices or automotive controls.

See Also


External Links