XPLink Support

Extra Performance Linkage, (from here on it is abbreviated to XPLink), is a z/OS® feature which provides high performance subroutine call and return mechanisms. This results in short and highly optimized execution path lengths.

Object Oriented programming is built upon the concept of sending 'messages' to objects which result in that object performing some actions. The message sending activity is implemented as a subroutine invocation. Subroutines, known as member functions in C++ terminology, are normally small pieces of code. The characteristic execution flow of a typical C++ program is, of many subroutine invocations to small pieces of code. Programs of this nature benefit from the XPLink optimization technology.

MVS™ has a standard subroutine calling convention which can be traced back to the early days of System/360. This convention was optimized for an environment in which subroutines were more complex, there were relatively few of them, and they were invoked relatively infrequently. Object oriented programming conventions have changed this. Subroutines have become simpler but they are numerous, and the frequency of subroutine invocations have increased by orders of magnitude. This change in the size, numbers, and usage pattern, of subroutines made it desirable that the system overhead involved be optimized. XPLink is the result of this optimization.

Note:

For z/OS 1.4 and above, and CICS® 3.1 and above, the advice here that you CAN use the XPLINK compiler option with CICS application programs, overrides z/OS advice to the contrary.

z/OS manuals for C and C++ advise you that the XPLINK compiler option is not available to CICS application programs, because that used to be the case. Although these manuals are now being changed, you may be working with a copy of one of these manuals produced before this change.

XPLink, and the X8 and X9 TCBs

CICS provides support for C and C++ programs compiled with the XPLINK option by using the multiple TCB feature in the CICS Open Transaction Environment (OTE) technology. X8 and X9 mode TCBs are defined to support XPLink tasks in CICS key and USER key respectively. Each instance of an XPLink program uses one X8 or X9 TCB.

To use XPLink, your C or C++ application code must be reentrant and threadsafe. The same code instance can be executing on more than one MVS TCB and, without threadsafe mechanisms to protect shared resources, the execution behavior of application code is unpredictable. This cannot be too strongly emphasized.

Writing C and C++ programs, which are to be compiled with the XPLINK option, for the CICS environment

The application developer is expected to do the following to take advantage of CICS XPLink support; All programs using CICS XPLink support must be re-entrant and threadsafe. Only the application developer can guarantee that the code for a particular application satisfies these requirements.

Passing control between XPLink and non-XPLink objects

Each transfer of control from XPLink objects to non-XPLink objects, or the reverse, causes a switch between the QR TCB and an open TCB, (either an X8 or an X9 TCB). In performance terms, TCB switching is costly, you must take this performance overhead into account.

An XPLink object can invoke a non-XPLink object using either the EXEC CICS interface or the Language Environment interface.

A non-XPLink object can only invoke an XPLink object using the EXEC CICS interface. Use of the Language Environment interface for such invocations is not supported.

Changing CICS definitions to obtain CICS support for objects compiled with the XPLINK option

CICS support for programs compiled with the XPLINK option requires only that you show in the PROGRAM resource definition that the program is threadsafe. This indication, and the XPLink "signature" in the load module, are the only things required to put the task on an X8 or X9 TCB.

In the selection of a suitable TCB for a particular program, XPLink takes precedence over the existence of the OPENAPI value for the API attribute on the PROGRAM resource definition.