CONCURRENCY(REQUIRED) programs
Defining an application program as CONCURRENCY(REQUIRED) means that from the start of the program, it always runs on an open task control block (open TCB) instead of the main CICS® quasi-reentrant TCB (QR TCB). If CICS must switch to the QR TCB to process an EXEC CICS command, CICS switches back to the open TCB before returning control to the application program.
- If the program uses only CICS supported APIs (including access to external resource managers such as DB2®, IMS, and IBM® MQ), it must be defined with program attribute API(CICSAPI). In this case CICS always uses an L8 open TCB, irrespective of the execution key of the program, because CICS commands do not rely on the key of the TCB.
- If the program is to use other non-CICS APIs, it must be defined with program attribute API(OPENAPI). In this case CICS uses an L9 TCB or an L8 TCB depending on the execution key of the program. This is to allow the non-CICS APIs to operate correctly.
Global user exits cannot be defined as CONCURRENCY(REQUIRED), but if you enable them using the THREADSAFE option on the ENABLE PROGRAM command, they can run on an open TCB when necessary.
Task-related user exits (TRUEs) can be defined or enabled as CONCURRENCY(REQUIRED), in which case, they must be written to threadsafe standards. A TRUE that is defined as CONCURRENCY(REQUIRED) API(OPENAPI) always runs on an L8 TCB. A TRUE that is defined as CONCURRENCY(REQUIRED) API(CICSAPI) can run on a T8, L8, or X8 TCB, depending on the need of the application environment. The CICS-DB2 TRUE is enabled as CONCURRENCY(REQUIRED) API(CICSAPI).
Existing threadsafe CICS-DB2 applications that are defined as THREADSAFE CICSAPI (to take advantage of the performance gains of being able to run on the same TCB as the DB2 call), can be further enhanced by defining them as REQUIRED CICSAPI. This definition means that the programs can run on an L8 open TCB immediately, without waiting for the first DB2 call to move them on to the open TCB. The additional benefit achieved depends on how many, if any, non-threadsafe CICS commands the application executes.