Choosing THREAD to support multithreading
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. However, THREAD might
adversely affect performance because of the serialization logic that
is automatically generated.
About this task
In order to run COBOL programs in more than one thread, you must
compile all of the COBOL programs in the application using the THREAD compiler
option. You must also compile them with the RENT compiler
option and link them with the RENT option of the binder (linkage-editor).
Use the THREAD option
when you compile object-oriented (OO) clients and classes.
Language
restrictions: When you use the THREAD option,
you cannot use certain language elements. For details, see the related
reference below.
Recursion: Before you compile a program using the THREAD compiler
option, you must specify the RECURSIVE phrase in
the PROGRAM-ID paragraph. If you do not do so, an
error will occur.