Previous Topic: CA Gen Requires PDSENext Topic: Install Gen Runtime Load Library Modules


Threadsafe

Since CICS/TS 1.3, all user programs defined in CICS have a concurrency attribute of Quasirent or Threadsafe. In CICS terms, Quasirent indicates that the program requires CICS protection when using sharable resources. Threadsafe means that the program maintains data integrity while it handles concurrent access of shared resources. CICS uses the concurrency attribute with information about the CICS API commands to decide under which TCB to execute the program, switching between TCBs if necessary.

In CICS/TS 2.2, IBM modified the task-related user exit used by the CICS-DB2 attachment facility so it executes as threadsafe and has started to modify the CICS API commands to make them threadsafe. Not all CICS API commands are threadsafe.

CICS starts all tasks using the quasirent TCB. When the program associated with a task executes an SQL command, CICS changes the task to the threadsafe TCB. After the SQL command completes, CICS determines under which TCB to continue executing the task based on the concurrency attribute of the executing program and of the CICS API command, if applicable.

When the program is defined as quasirent, CICS switches the task to the quasirent TCB where it remains until the next SQL command executes. When the program is defined as threadsafe the task continues executing in the threadsafe TCB until the next non-threadsafe CICS API command executes.

Applications that access DB2 resources and are defined as quasirent must do TCB switching. TCB switching impacts application performance.

The Advantage Gen 6.5 CICS runtime is not threadsafe. Advantage Gen 6.5 CICS applications fail with a variety of 0Cx abends if defined as threadsafe, and must be defined as quasirent.

In AllFusion Gen 7, the z/OS runtimes were made threadsafe. Define AllFusion Gen applications installed using runtimes from AllFusion Gen 7.x, and CA Gen 8.x as threadsafe. They operate without abending.

To benefit from reduced TCB switching, when you use the CA Gen DB2 Dynamic Plan Exit TIRC$EXT, define it as threadsafe. The DB2 Dynamic Plan Exit is used for plan selection when the CA Gen CICS option XCTL for Flows is selected.

CA Gen programs execute the non-threadsafe CICS API commands at the start of each program to receive or retrieve the input data, and at the end to send or omit the response. CA Gen programs defined as threadsafe perform fewer TCB switches than the same programs defined as quasirent. This applies to statically and dynamically linked CA Gen applications. There are a few points to notice: