Writing z/OS UNIX System Services applications

 

The batch adapter supports queue manager connections from batch and TSO address spaces:

If we consider a Batch address space, the adapter supports connections from multiple TCBs within that address space as follows:

z/OS OpenEdition supports two types of pthread_create call:

  1. Heavyweight threads, run one for each TCB, that are ATTACHed and DETACHed at thread start and end by z/OS.

  2. Medium-weight threads, run one for each TCB, but the TCB can be one of a pool of long-running TCBs. The application must perform all necessary application cleanup, because, if it is connected to a server, the default thread termination that might be provided by the server at task (TCB) termination, is not always driven.

Lightweight threads are not supported. (If an application creates permanent threads that dispatch their own work requests, the application is responsible for cleaning up any resources before starting the next work request.)

WebSphere MQ for z/OS supports z/OS OpenEdition threads using the Batch Adapter as follows:

  1. Heavyweight threads are fully supported as batch connections. Each thread runs in its own TCB, which is attached and detached at thread start and end. Should the thread end before issuing an MQDISC call, WebSphere MQ for z/OS performs its standard task cleanup, which includes committing any outstanding unit of work if the thread terminated normally, or backing it out if the thread terminated abnormally.

  2. Medium-weight threads are fully supported, but if the TCB is going to be reused by another thread, the application must ensure that an MQDISC call, preceded by either MQCMIT or MQBACK, is issued before the next thread start. This implies that if the application has established a Program Interrupt Handler, and the application then abends, the Interrupt Handler must issue MQCMIT and MQDISC calls before reusing the TCB for another thread.

Threading models do not support access to common WebSphere MQ resources from multiple threads.

 

Parent topic:

Using and writing applications on WebSphere MQ for z/OS


fg15240_