Reentrancy considerations

You can make multiple calls to main routines by invoking CEEPIPI services and making multiple requests from a single PreInit table. In general, you should specify only reentrant routines for multiple invocations, or you might get unexpected results.

For example, if you have a reentrant C main program that is invoked using (call_main) and that uses external variables, then when your routine is invoked again, the external variables are re-initialized. Multiple executions of a reentrant main routine are not influenced by a previous execution of the same routine.

However, if you have a nonreentrant C main program that is invoked using (call_main) and that uses external variables, then when your routine is invoked again, the external variables can potentially contain last-used values. Local variables (those contained in the object code itself) might also contain last-used values. If main routines are allowed to execute multiple times, a given execution of a routine can influence subsequent executions of the same routine.

If you are calling init_sub, init_sub_dp, or add_entry for C/C++, the routines can either be naturally reentrant or may be compiled RENT and made reentrant by using the z/OS C Prelinker Utility. If the subroutine is made reentrant using the z/OS C Prelinker Utility, multiple instances of the same subroutine are influenced by the previous instance of the same subroutine.

If you have a nonreentrant COBOL program that is invoked using (call_main), condition IGZ0044S is signaled when the routine is invoked again.