### Subsystems

A subsystem is a collection of code and/or data that can be shared across processes and that does not use the IBM C and C++ Compilers runtime environment.

A subsystem may have code and data segments that are shared by all processes, or it may have separate segments for each process. If the subsystem is a dynamic link library, there is also an initialization routine associated with it.

By default, IBM C and C++ Compilers creates a runtime environment for you using C or C++ initializations, exception management, and termination. This environment allows runtime functions to perform input/output and other services. However, many applications require no runtime environment and must be written as subsystems. For example, you should turn off the runtime environment support to:

- Reduce the size of the executable file
- Develop Presentation Manager display or printer drivers
- Develop virtual device drivers
- Develop installable file system drivers
- Create DLLs with global initialization and termination and a single automatic data segment that is shared by all processes. The initialization/termination function is called once when the DLL is first loaded and once more when it is last freed.

Subsystem Libraries

Create a DLL - An Overview
Choose Run-Time Libraries
Create a Subsystem
Create a Subsystem DLL
Create Your Own Subsystem Runtime Library

Summary of Subsystem Library Functions