Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Transferring control to multithreaded programs

When you write COBOL programs for a multithreaded environment, choose appropriate program linkage statements.

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.

In general, it is recommended that the programs that initiate and manage multiple threads use the COBOL preinitialization interface.

If your program initiates multiple COBOL threads (for example your C program calls COBOL programs to carry out the input and output of data), do not assume that the COBOL programs will clean up their environment, such as releasing storage no longer needed. In particular, do not assume that files will be automatically closed. You should preinitialize the COBOL environment so that your application can control the COBOL cleanup.

related concepts
Preinitializing the COBOL runtime environment

related tasks
Ending multithreaded programs
Ending and reentering main programs or subprograms


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)