REMOVE THREAD Service

The REMOVE THREAD call signals
RLX
/CAF to detach the MVS subtask created for a Db2 application plan thread and to release the resources associated with that task and thread.
The REMOVE THREAD call signals
RLX
/CAF to detach the MVS subtask created for a Db2 application plan thread and to release the resources associated with that task and thread. REMOVE THREAD is the inverse of the CREATE THREAD service.
>>---REMOVE THREAD--+----------------+-------------->< | | +--(:hv_handle)--+
The REMOVE THREAD service provides developers with more granular and dynamic control of thread management.
RLX
/CAF lets you create and remove threads at your discretion to provide applications with greater flexibility and tuneability.
REMOVE THREAD signals
RLX
/CAF to perform the following action:
  • Terminate the application thread.
  • Detach the SQL interface task.
  • Free the thread control block.
If the referenced thread is open,
RLX
/CAF implicitly issues a CLOSE request using the SYNC option. If the thread remains CONNECTed,
RLX
/CAF will DISCONNECT it. The following is an example of a CAF REMOVE THREAD request:
'CAF REMOVE THREAD(:
THREAD
)
Where
THREAD
specifies a REXX variable which contains the thread handle returned by a successful
ACTIVATE
or
CREATE THREAD
call.