Availability Guide for Application Design
Minimizing Programming Errors
Availability Guide for Application Design—525637-004
9-2
Shared Run-Time Libraries
Reusable modules come in two forms:
•
Shared run-time libraries that can be used for programs written in traditional
languages such as C and pTAL
•
Reusable objects appropriate for object-oriented languages such as C++ or Java
Shared Run-Time Libraries
Shared run-time libraries (SRLs), sometimes called shared resource libraries, are
object files used by more than one process at a time.
SRLs are only available on TNS/R systems, they have been replaced by DLLs on
TNS/E systems. (DLLs are also available on TNS/R systems after G20.06.)
SRLs are usually used by system programs to reduce memory usage or replace
problematic code with corrected code, but you can create an SRL for an TNS/R native
application so that more than one process can run the same program module.
An SRL is linked to your program object file at run time. When more than one program
object file uses an SRL, only one copy of that SRL is kept in virtual memory; all
programs receive duplicates of the global data in that one copy.
An TNS/R native SRL can be either public or private. An TNS/R native process can
have multiple public SRLs but only one private SRL. An TNS/R native user library is
available to TNS/R native processes as a special TNS/R native private SRL.
The advantages of an SRL are:
•
It can be debugged and compiled once for use in multiple programs
•
It can be replaced while a process is running
The disadvantages of an SRL are:
•
Subtle variations in application behavior can occur when one of the processes
using a modified SRL uses that SRL in a slightly different way than the processes
with which the SRL was tested.
•
SRL replacement with running processes can be a complex task. Changing a
NonStop Process Pair on page 10-38 provides a brief overview of this process.
For a complete discussion of TNS/R native SRLs, refer to the nld and noft Manual. For
a discussion of TNS SRLs, refer to the Binder Manual.
For a detailed discussion of the use of DLLs, see either the DLL Programmer’s Guide
for TNS/R Systems or DLL Programmer’s Guide for TNS/E Systems.
Reusable Objects
Object-oriented programming techniques can improve the reliability of your code
because they make use of reusable objects.