OTMA program switch to multiple programs

After a program inserts back to the I/O PCB, the rest of the program to program message switch, if any, is processed asynchronously.

For example, Program A switches to Program B, which inserts back to the I/O PCB. The output from Program B will be a send-then-commit message. Program B then switches to program C, which will be processed asynchronously.

A race condition can occur when a program switches to multiple programs. Program A switches to multiple programs using non-express PCBs. Only one switched-to program, the one scheduled first, is processed synchronously. The rest of the switched-to programs are processed asynchronously. If the program processed synchronously inserts back to the I/O PCB, the output message is a send-then-commit message.

In some cases, one of the multiple programs could be a remote program. This program flow is shown in the following figure. Program A switches to remote Program B through MSC. Program B first launches a new program, Program C, in the local IMS and then inserts a response to the OTMA client through the local IMS. Depending on what happens first (scheduling of Program C or the processing of the response for the OTMA client) in the local IMS, an unwanted DFS2082 message could be sent to the client. This is also a race condition. If Program C gets processed first in the local IMS, a DFS2082 message is sent. If the response is processed first, the expected output from Program B is delivered synchronously using send-then-commit.

Figure 1. Race condition resulting from program switch to multiple programs
To avoid creating the race condition in these circumstances, you can do any one of the following:
  • Modify your programs to avoid multiple program-to-program switches within the same transaction for send-then-commit (CM1).
  • Use commit-then-send (CM0) input when performing multiple program-to-program switches within the same transaction.
  • Use the IMS start-up parameter OTMAASY to serialize P2P message switch processing.

When you use the OTMAASY parameter to avoid a race condition, you can create a program switch model similar to the single-stream model. For example, in the preceding figure, Program B, for which the response mode transaction is processed synchronously, can deliver the send-then-commit (synchronous) output message. Program C, which is running with a non-response mode transaction, processes the message asynchronously.