Multiprogramming and Multitasking

A multiprogramming operating system allows the concurrent execution of multiple applications in the same machine. A multitasking operating system is an extension of the multiprogramming concept, which distributes processor time among multiple applications by giving each application access to the processor for short periods of time. OS/2 implements both multiprogramming and multitasking.

Multitasking may be supported in two forms:

  • Cooperative multitasking requires the active support of applications running in the system, which must explicitly relinquish control of the processor to allow other applications to execute. This form of multitasking is unreliable and frequently leads to poor performance, since an ill-behaved application can monopolize the processor.

  • Pre-emptive multitasking uses a scheduler as part of the operating system; the scheduler is responsible for selectively dispatching and suspending multiple concurrent tasks in the system. This form of multitasking is more sophisticated, typically leads to greater overall system throughput, and allows implementation of priority dispatching schemes for various tasks.

    Numerous mechanisms exist for providing multiprogramming support under DOS; these include products such as Microsoft Windows. However, since such facilities are ultimately dependent upon the single-tasking architecture of the DOS operating system, they typically provide only limited multitasking capabilities; where pre-emptive multitasking is supported, schedulers are typically primitive and performance is relatively poor. Pre-emptive multitasking is not possible during input/output operations, since these operations are performed by the single-tasking DOS operating system.

    OS/2 provides pre-emptive multitasking under the control of the operating system, which is designed to use the multitasking protected mode of the Intel 80286 and 80386 processors. OS/2 implements a pre-emptive task scheduler with a multi-level priority scheme, which provides dynamic variation of priority and round-robin dispatching within each priority level. The dynamic variation of priority is achieved on the basis of current activity, and is intended to improve overall system performance and ensure that the system as a whole responds adequately to user interactions. For circumstances where dynamic variation of priority is inappropriate, the dynamic variation may be disabled using a command in the CONFIG.SYS file, and task priority then becomes absolute. In either case, task priority may be set and altered dynamically using a number of operating system functions available to OS/2 application programmers.

    The management of tasks executing in the system is further simplified and streamlined under OS/2 Version 2.0. This is due primarily to the fact that support for processes executing in real mode (such as the DOS Compatibility Box in OS/2 Version 1.3) is no longer required, since the execution of DOS applications is supported using virtual DOS machines which run as protected mode processes. See DOS Application Support for further information.


    [Back: Memory Management]
    [Next: Application Support]