System scope initializer programming
considerations
Use the system scope initializer for
procedural C/C++ language applications
only (C/C++ language applications
that do not rely on constructors). Process scope constructors and
destructors will not be called before the system scope initializer is called.
The system scope initializer only
can call the following:
Functions in a CSO
Functions in standard C language and z/TPFC language libraries.
Run the system scope initializer the
first time a program is called by an entry control block (ECB). A function
in a program must be run before data modified by the system scope initializer is viewed
by the z/TPF system.
It is recommended that data references in the program are bundled.
This provides initialization support to all code in the same CSO that access
the initialized data.
You can specify only one initialization function and one termination
function for each CSO version.
You do not have to specify both because the initialization function
runs before a CSO version
is run on your z/TPF system.
If the system scope initializer and
termination functions are specified and run in alternate versions
of a program, these functions are run once for each program version.
Do not initialize global data to point to any storage (ECB heap,
stack storage, or core blocks) that is released at ECB exit time.
The system scope initializer and
termination functions do not support BAL shared objects (BSOs).
Do not use the system scope initializer with imported
variables because the changes will be lost and the z/TPF system view is not
modified.
When a program that contains
a system scope initializer is
activated as part of a loadset, the initializer is called during the
loadset activation. To avoid fully activating the loadset if the initializer
fails, the initializer must be run before the loadset activation completes.
Therefore, other programs in the same loadset cannot be called while
the initializer is processing. If the initializer calls functions
that reside in other programs in the loadset, only previously activated
versions or base versions of the programs can be called.