Dynamic Link Libraries – DLL



Chapter:Chapter 02 – Inside OS/2 Warp
Subsection: 01. Base Operating System Architecture
Document Number:07
Topic: Dynamic Link Libraries – DLL
Date Composed: 01-30-97 09:50:14 AM Date Modified: 01-30-97 10:13:25 AM

OS/2 uses libraries of executable code call Dynamic Link Libraries, or DLLs. DLLs are used to improve the performance of OS/2 and application programs and to reduce the amount of disk space and RAM required to store and run programs.

Dynamic linking means that the DLLs are linked to the EXE code at load time or at run time rather than when the program is linked by the programmer. Static linking places all of the runtime code into a single large executable module which must be loaded into RAM in its entirety. Becuase many DLLs are designed to be loaded into RAM only when they are called by a program, this can make load time faster so that programs begin to run faster.

DLLs can be used by many programs rather than just one. Since many functions residing in a DLL are needed by many executable programs, a single DLL can take the place of static linking the same code multiple times into multiple exectable files. This saves disk space and RAM because a single instance of a DLL in RAM can be used by multiple programs.

Dynamic linking can be accomplished in two ways under OS/2.

  1. Load-time dynamic linking loads DLLs called from within a code segment at the time the segment is loaded into memory. This causes load time to be longer but can result in improved run-time performance, especially if the DLL is used frequently.
  2. Run-time dynamic linking postpones loading the DLL until the code actually calls a function in the DLL. This reduces the time required to initially load the program and get it running, and also results in a smaller RAM footprint. This is appropriate for DLLs which are infrequently used because it can impact performance slightly as DLLs are loaded during execution of programs.