16-Bit Application Compatibility

An important feature of OS/2 Version 2.0 is its ability to run existing 16-bit applications, written for previous versions of OS/2, without alteration. This compatibility is achieved internally by the operating system through a special interface called a thunk. A thunk is a piece of code responsible for converting 16-bit segmented memory references to 32-bit linear references and vice versa, as well as realigning the thread's stack and data structures where necessary. This restructuring allows the 16-bit applications to interface with 32-bit service layers within the operating system, and allows 32-bit applications to utilize 16-bit service layers, modules and resources.

Applications may also be written for the 32-bit environment, while making use of existing 16-bit DLLs and resources. This technique is known as mixed model programming, and allows the application developer to make the best possible use of existing service routines, private window classes, etc., developed for previous versions of OS/2.

Note, however, that the use of mixed 16-bit and 32-bit modules within an application requires special consideration by the application developer, since the 16-bit modules utilize the segmented memory model, and therefore are restricted in the size and location of the memory objects to which they have access. The subject of mixed-model programming is discussed in greater detail in OS/2 Version 2.0 - Volume 4: Application Development.


[Back: 32-Bit Programming Environment]
[Next: Installation]