Controls reentrancy of a multithreading program. Any program that is to be reentrant in a multi-threaded application must
be compiled with this directive. If REENTRANT is specified, many program areas are dynamically allocated, so that it is safe
to have multiple copies of the program running.
Syntax:
>>-.---.-.-----REENTRANT---"n"--.-------><
+-/-+ +-NO--REENTRANT--------+
Parameters:
-
n
- One of:
- 1
- All compiler-generated temporary work areas are allocated on a per thread basis. All user data and FD file areas allocated
in the Environment and Data Divisions will be shared by all threads. It is the responsibility of the programmer to ensure
serialization to the program's data by use of the CBL_ synchronization calls.
- 2
- All user data and FD file areas allocated in the Environment and Data Divisions are allocated on a per thread basis. EXTERNAL
data and files will always be shareable by all threads.
Properties:
Default:
|
NOREENTRANT
|
Phase:
|
Syntax check
|
$SET:
|
Initial
|
Comments:
Use REENTRANT"1" wherever possible for any program you wish to be reentrant. Use REENTRANT"2" only as the first step towards converting an existing program to be reentrant.