gtpc2m4j | C/C++ Language Support User's Guide |
This function is used to check if enough system resources are available to
begin processing low-priority or batch work, and to determine if an entry
control block (ECB) can be suspended (based on the level of available
resources).
An ECB that calls the lodic function is marked as a low-priority
ECB. Once marked, the ECB can be suspended when system resources are
below the shutdown levels defined for the BATCH priority class (see Table 10). Even though the ECB is marked as being able to be
suspended, the ECB cannot be suspended until it gives up control. Once
the ECB has been suspended, it will not receive control again until enough
system resources are available.
Format
#include <tpfapi.h>
int lodic();
Normal Return
The return code depends on the shutdown levels that are defined for the
BATCH priority class (see Table 10).
- 0
- The available system resources are below the shutdown levels defined for
the BATCH priority class (more work will not be started).
- 1
- The available system resources are above the shutdown levels defined for
the BATCH priority class (more work is allowed to be started).
Error Return
Not applicable.
Programming Considerations
- This function can run on any I-stream.
- Once an ECB has been marked as capable of being suspended, it becomes
suspended whenever the ECB gives up control and the available system resources
are below the defined shutdown levels (unless the ECB is holding a
resource). Once suspended, the ECB will remain suspended until the
available system resources return to levels above the defined shutdown
levels.
- The create functions, cremc, credc,
swisc_create, crexc, and creec, will pass the
lodic parameters from the parent ECB to the child ECB. If
the parent ECB is marked as being able to be suspended, the child ECB is also
marked in the same way. The other create functions, cretc
and cretc_level, do not pass this information.
- When you use a function to create an ECB (such as cremc or
swisc_create), the ECB is not created immediately. First, a
system work block (SWB) is placed on a list in the CPU loop. The ECB is
not actually created until the SWB is dispatched from the list. Because
of this delay, call the lodic function each time before creating a
single ECB. The application calling the lodic function
should give up control before calling the lodic function again to
ensure that ECBs that are created are given a chance to receive control and
perform work. Otherwise, system resource depletion can result from too
much work being scheduled and not started.
- Suspended ECBs that are using a large amount of resources can result in
conditions in which these ECBs never get back control. Avoid having an
ECB become suspended if it is using a large amount of resources.
- Use the lodic_ext function to prevent this ECB from becoming
suspended after you run the lodic function.
- ECBs that are suspended because of a lodic call will be purged
during cycle-down to 1052 state unless they have been previously identified to
survive cycle-down.
Examples
The following example creates a new ECB after checking to see if available
resources exist. The ECB is also marked as a low-priority batch ECB and
is allowed to be suspended while resources are not held.
#include <tpfapi.h>
void QZZ0();
·
·
·
rc = lodic();
if (rc) credc( 0, NULL, QZZ1 );
Related Information
lodic_ext-Check System Load and Mark ECB with Extended Options.