CICS Sockets OTE
CICS Sockets OTE
Programs are said to be quasi-reentrant programs because they take advantage of the
behavior of the CICS dispatcher and the QR TCB.
ƒ There is only ever one CICS task active under the QR TCB.
–The same program can be executed by multiple CICS tasks
–Only one of those CICS tasks is active at any given point in time
Quasi-reentrant programs running under the QR TCB are safe in the knowledge that
they are the only CICS user task running at that instance.
ƒ Can access shared resources such as the CICS Common Work Area (CWA)
ƒ Can access shared storage obtained via EXEC CICS GETMAIN SHARED
ƒ Running under the QR TCB guarantees serialized access to shared resources
Private pool of
LST1 reusable socket
CICS TS Region subtasks
LST2 z/OS
TCP/IP
TRNA T Stack
R
EZAO
U
EZAC E
PLTxx CICS/ESA or
CICS TS Region
Build
EZACICD cfg
TRANA
EZASOKET
POST
WAIT TRANB
EZASOH03
EZASOKET
POST POST
WAIT WAIT
EZASOH03
EZASOKET
POST
WAIT POST
EZASOH03 WAIT
POST EZASOKET
WAIT POST
WAIT
EZASOH03
EZASOKET
POST POST
WAIT WAIT
EZASOH03
RETURN
POST
WAIT
RETURN
There are several modes of open TCBs, used to support various functions.
ƒ Java in CICS, for example employs a type of OTE TCB commonly referred to as “J8”
ƒ Open API Task Related User Exits employ the “L8” TCB
–This is what happens if a blocking EZASOKET request is issued under the QR TCB.
Blocking means the TCB is halted, the TCB is not being dispatched.
ƒ Examples of non CICS APIs would be:
–MVS services
GETMAIN
MVS UNIX System Services POSIX functions.
–DB2 SQL
–MQSeries
CICS assumes responsibility for ensuring the integrity of the resources it manages.
ƒ Either the CICS TS code has been amended to run on multiple TCBs safely
–temporary storage requests
ƒ Or CICS TS will ensure the code runs on the QR TCB
–File Control requests.
Therefore the use of non-threadsafe CICS commands that must run on the QR TCB has a
performance penalty (due to the need to switch TCBs), but there is no risk to data
integrity.
If the same quasi-reentrant program would run in an OTE environment, multiple
instances of this program could execute at the same time.
ƒ The counter value in the CWA could be changed by multiple executors at the same time and one
instance would never be sure about the counter value when it stops or gets suspended.
What is threadsafe?
“threadsafe application”
Therefore, an application system cannot be “threadsafe” until all programs that share
a common resource implement that application’s threadsafe standards.
Program
Stub
TRUE Resource Non-CICS
Manager resource
such as
z/OS TCP/IP
The L8 TCBs are solely managed by CICS TS. The active L8 TCB pool size is limited by
the CICS MAXOPENTCBS System Initialization parameter. The CICS ACTOPENTCBS
will indicate the number of L8 TCBs in use at any instance.
CICS TS Region
PLTxx
CICS TS 2.2 Region
Build
EZACICD cfg
ƒ Listener
Note:
ƒ To exploit CICS Sockets OTE: EXEC CICS
7
WRITEQ TD
Update the listener security exit routine
CHANGE MODE
Make sure CICS Sockets applications are 8
threadsafe WRITEQ TD
ƒ CICS TS 2.3 level is recommended (2.2 will work!)
RETURN
RBs RBs
Region
DUMP
IEAVTSDT CTL IEESB605
Task
Task
Region RBs
CTL
IEFIIC MVS stuff above the line
Task
LLEs RBs
JOB
CDEs
Step DFHSIP
TCB
RBs
RBs
FO
DFHTRTCB
Aux
TCB
DFHKETCB The FO (File) TCB was added in R510
Trace
RBs
RO
DFHKETCB
TCB
RBs
QR
DFHKETCB
TCB
MAXOPENTCBS is a CICS TS configuration option that is used to limit the size of the Open API, L8, TCB
pool. Its range is from 1-2000 with a default of 12. When the number of tasks using L8 TCBs reaches
MAXOPENTCBS, then any new work will be suspended by CICS TS until tasks end or MAXOPENTCBS is
increased.
ƒ Remember, TCB storage is allocated from Local System Queue Area (LSQA). MAXOPENTCBS can by set by
ƒ A value of NO causes IP CICS Sockets to continue executing EZASOKET calls on an MVS subtask managed by the IP CICS Sockets
interface.
ƒ If OTE=YES, then the values of NTASKS, DPRTY and TERMLIM will be forced to zero if specified.
When OTE=YES is specified, CICS TS will switch all calls from the QR TCB to an L8 TCB
ƒ All EZASOKET calls
ƒ Listeners will not be subject to this limitation; however, they will be subject to CICS's MAXOPENTCBS.
–This allows listeners to be started thereby prohibiting a possible denial of service.
–If MAXOPENTCBS is reached
Then no more open API TCBs are available in the CICS region and
The IP CICS Sockets task-related user exit cannot obtain an open TCB for its use
ƒ IP CICS Sockets supports a TCB limiting mechanism to manage its use of the L8 TCBs.
ƒ When TCBLIM is set to the same value as MAXOPENTCBS, it will never be enforced due to CICS's management of the L8
pool size.
ƒ When a CICS region is at MAXOPENTCBS, any new work exploiting an Open API enabled TRUE will wait until an L8 TCB
becomes available either through task end or by increasing MAXOPENTCBS
–The EZAO,SET,CICS transaction can be used to change TCBLIM dynamically
ƒ Listeners defined to the IP CICS Sockets interface are not subject to TCBLIM but are subject to MAXOPENTCBS
ƒ The current queue depth of tasks that have been queued by TCBLIM
PF 3 END 12 CNCL
ƒ EZACIC02 - Listener
–The Listener will incur less TCB switching if run on CICS TS V2R3
ƒ EZACIC12 - WLM Registration/Deregistration
ƒ Sample programs
–EZACIC17
ƒ EZACIC21 - Initialization
ƒ EZACIC22 - Termination
ƒ EZACIC23 - Configuration
–This is not marked as threadsafe as it will always incur a TCB switch due to non-threadsafe CICS commands.
ƒ EZACIC07 is the non-reentrant application stub providing C socket support for non-reentrant C CICS programs.
Application programs using the EZACIC07 application stub cannot be defined as threadsafe. Use EZACIC17 instead.
interaction OTE
15000
12% less CPU per non-OTE
interaction
10000
5000
0
0 10 20 30 40 50 60
Number of send/receive (interactions) operations per transaction
CICS Sockets transactions that issue many sockets calls and/or use both SQL and
sockets calls will see most benefit from using OTE
ƒ QR INCLUDES 1 + 8 3 EZASOH03
2
ƒ MS CPU
EXEC CICS
CO, RO, etc. TCBs 7
WRITEQ TD
CHANGE MODE
ƒ USER CPU includes QR, L8, MS 8
1+2+3+4+5+6+7+8+MS WRITEQ TD
RETURN
Child server transaction program must be coded to threadsafe programming standards and defined to CICS as
CONCURRENCY(THREADSAFE) to prevent TCB switching and ensure shared resource integrity.
Use the CICS supplied load module scanner program, DFHEIDTH, to locate non-threadsafe CICS commands in your
programs
########################################################################
# CICS LOAD MODULE SCANNER FILTER TABLE - THREADSAFE INHIBITORS #
# This table identifies commands which "may" cause the program not to #
# be threadsafe in that they allow accessibility to shared storage and #
# the application must have the necessary synchronization logic in #
# place to guard against concurrent update. #
########################################################################
# The extract command obtains the address and length of the global #
# work area for the GLUE or TRUE. #
########################################################################
EXTRACT EXIT GASET *
GETMAIN SHARED *
ADDRESS CWA *
ASKTIME * # Threadsafe in CICS TS V2R3
FORMATTIME * # Threadsafe in CICS TS V2R3
SYNCPOINT *
WRITE JOURNALNAME
WRITE FILE
WRITEQ TD
The solution to the following APARs is recommended to enable best sockets performance
in an OTE environment:
ƒ APARs OA13252 and OA13278
Jim Grauel
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are registered trademarks of Microsoft Corporation in the United States, other countries, or both.
Intel, ActionMedia, LANDesk, MMX, Pentium and ProShare are trademarks of Intel Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other company, product and service names may be trademarks or service marks of others.
Product data has been reviewed for accuracy as of the date of initial publication. Product data is subject to change without notice. This document could include technical inaccuracies or typographical errors. IBM may make
improvements and/or changes in the product(s) and/or program(s) described herein at any time without notice. Any statements regarding IBM's future direction and intent are subject to change or withdrawal without notice,
and represent goals and objectives only. References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which
IBM operates or does business. Any reference to an IBM Program Product in this document is not intended to state or imply that only that program product may be used. Any functionally equivalent program, that does not
infringe IBM's intellectual property rights, may be used instead.
Information is provided "AS IS" without warranty of any kind. THE INFORMATION PROVIDED IN THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IBM
EXPRESSLY DISCLAIMS ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. IBM shall have no responsibility to update this information. IBM products are
warranted, if at all, according to the terms and conditions of the agreements (e.g., IBM Customer Agreement, Statement of Limited Warranty, International Program License Agreement, etc.) under which they are provided.
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this
publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. IBM makes no representations or warranties, express or implied, regarding non-IBM products and
services.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents or copyrights. Inquiries regarding patent or copyright licenses should be made, in writing, to:
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. All customer examples described are presented as illustrations of how those customers have used IBM
products and the results they may have achieved. The actual throughput or performance that any user will experience will vary depending upon considerations such as the amount of multiprogramming in the user's job
stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve throughput or performance improvements equivalent to the
ratios stated here.