[UNIX, Linux, Windows, IBM i]

Multiple thread support - pipelining

You can optionally allow a message channel agent (MCA) to transfer messages using multiple threads. This process, called pipelining, enables the MCA to transfer messages more efficiently, with fewer wait states, which improves channel performance. Each MCA is limited to a maximum of two threads.

You control pipelining with the PipeLineLength parameter in the qm.ini file. This parameter is added to the CHANNELS stanza:
PipeLineLength= 1 | number
This attribute specifies the maximum number of concurrent threads a channel uses. The default is 1. Any value greater than 1 is treated as 2.
Note: Pipelining is effective only for TCP/IP channels.

When you use pipelining, the queue managers at both ends of the channel must be configured to have a PipeLineLength greater than 1.

Channel exit considerations

Pipelining can cause some exit programs to fail, because:
  • Exits might not be called serially.
  • Exits might be called alternately from different threads.
Check the design of your exit programs before you use pipelining:
  • Exits must be reentrant at all stages of their execution.
  • When you use MQI calls, remember that you cannot use the same MQI handle when the exit is invoked from different threads.

Consider a message exit that opens a queue and uses its handle for MQPUT calls on all subsequent invocations of the exit. This fails in pipelining mode because the exit is called from different threads. To avoid this failure, keep a queue handle for each thread and check the thread identifier each time the exit is invoked.