Transferring control to multithreaded programs
When you write COBOL programs for a multithreaded environment, choose appropriate program linkage statements.
About this task
As in single-threaded environments, a called program is in its
initial state when it is first called within a run unit and when it
is first called after a CANCEL
to the called program. Ensure that the program that you name on a CANCEL
statement
is not active on any thread. If you try to cancel an active program,
a severity-3 Language Environment® condition
occurs.
If your threaded application
requires preinitialization, use the Language Environment services
(CEEPIPI interface). You cannot use the COBOL-specific interfaces
for preinitialization (runtime option RTEREUS
)
to establish a reusable environment from any program that has been
compiled with the THREAD
option.
Language Environment Programming Guide (What happens during termination:
enclave termination)