Task Management

The management of processes and threads executing in the system is greatly simplified and streamlined under OS/2 Version 2.0. This improvement is due primarily to the fact that support for processes executing in real mode (such as the DOS Compatibility Box in previous versions of OS/2) is no longer required, since the execution of DOS applications is supported using virtual DOS machines which run as protected mode processes under OS/2 Version 2.0 (see section Multiple Virtual DOS Machines for further information).

OS/2 Version 2.0 supports execution of the following types of applications:

  • DOS applications, in full-screen mode or in windows on the Presentation Manager desktop.

  • Windows applications, running in a full-screen session or in windows on the Presentation Manager desktop.

  • 16-bit OS/2 applications developed for previous versions of OS/2.

  • New 32-bit applications developed for OS/2 Version 2.0.

    All applications execute as protected mode processes under OS/2 Version 2.0, and are therefore provided with pre-emptive multitasking and full memory protection between processes.

    Interrupt handling under OS/2 Version 2.0 is simplified by removal of the need to handle real mode software interrupts. Interrupts issued by DOS and Windows applications are trapped and translated to the appropriate device access commands for the protected mode environment.

    Signal handling has been combined with exception handling, giving a more elegant and flexible means for an application to handle events such as Ctrl+Break and DosKillProcess() calls. Applications may register exception handling routines to trap such events. These routines are registered on a per-thread basis, allowing multiple applications to trap the same exception type, and may be chained or nested. Exception handlers may be written in high-level languages such as C; the use of assembler language is not required.

    The number of threads per process has been raised under OS/2 Version 2.0 to 4096, which is equal to the total system thread limit. Thus, a process may consume as many threads as required, up to the total available after the operating system itself has consumed a number of threads for its own use.

    The process of dispatching secondary threads has been streamlined through the incorporation of stack allocation/deallocation into the DosCreateThread() function under Version 2.0. This improvement simplifies the process of thread dispatching by removing the need for an application to explicitly allocate and free memory for the secondary thread's stack.

    Semaphores for maintaining synchronization between threads and processes are more sophisticated under OS/2 Version 2.0, and their implementation is less dependent on the processor architecture. In addition, system functions are provided which enable a thread to wait for the completion of another thread, or to forcibly terminate another thread. This functionality provides additional flexibility compared to previous versions of OS/2.


    [Back: Memory Management]
    [Next: 32-Bit Programming Environment]