Use the THREAD compiler option for multithreading support. Use THREAD if your program will be called in more than one thread in a single process by an application (such as MQ applications). However, THREAD might adversely affect performance because of the serialization logic that is automatically generated.
In order to run COBOL programs in more than one thread, you must compile all of the COBOL programs in the run unit with the THREAD compiler option. You cannot mix programs compiled with THREAD and compiled with NOTHREAD in the same run unit.
Use the THREAD option when you compile object-oriented (OO) clients and classes.
You must use the THREAD option for CICS TXSeries applications.
Language restrictions: When you use the THREAD option, you cannot use certain language elements. For details, see the related reference below.
Recursion: When you compile a program with the THREAD compiler option, you can call the program recursively in a threaded or nonthreaded environment. This recursive capability is available regardless of whether you specified the RECURSIVE phrase in the PROGRAM-ID paragraph.
related tasks
Sharing data in recursive or multithreaded programs
Compiling OO applications
Compiling and running CICS programs
related references
THREAD