This section contains some hints on using DLLs efficiently. Effective
use of DLLs may improve the performance of your application.
- If you are using a particular DLL frequently across multiple address
spaces, the DLL can be installed in dynamic LPA. Installing in dynamic
LPA may give you the performance benefits of a single rather than
multiple load of the DLL.
- Group external variables into one external structure.
- When using z/OS UNIX avoid unnecessary load attempts.
Language Environment supports
loading a DLL residing in the HFS or a data set. However, the location
from which it tries to load the DLL first varies depending whether
your application runs with the runtime option POSIX(ON) or POSIX(OFF).
If your application runs with
POSIX(ON),
Language Environment
tries to load the DLL from the HFS first. If your DLL is a data set
member, you can avoid searching the HFS directories. To direct a
DLL search to a data set, prefix the DLL name with two slashes (//)
as is in the following example:
//MYDLL
If your
application runs with
POSIX(OFF),
Language Environment tries to load your
DLL from a data set. If your DLL is an HFS file, you can avoid searching
a data set. To direct a DLL search to the HFS, prefix the DLL name
with a period and slash (./) as is done in the following example.
./mydll
Note: DLL names are case sensitive
in the HFS. If you specify the wrong case for your DLL that resides
in the HFS, it will not be found.
- For C/C++ IPA, you should only export subprograms (functions
and C++ methods) or variables that you need for the interface to
the final DLL. If you export subprograms or variables unnecessarily
(for example, by using the EXPORTALL option), you severely
limit IPA optimization. In this case, global variable coalescing
and pruning of unreachable or 100% inlined code does not occur. To
be processed by IPA, DLLs must contain at least one subprogram. Attempts
to process a data-only DLL will result in a compilation error.