You are on page 1of 17

17

UNDERSTANDING

THREADSAFE

Access Computing Education


17

OBJECTIVES

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

Channel
Paths

I/O SUBSYSTEM

CPU 0 CPU 1 CPU2 CPU 3

PSW PSW PSW PSW


Execution Execution Execution Execution
Set Set Set Set
Registers Registers Registers Registers

PSW
Execution
Set
Registers

LOGICAL PARTITION
Access Computing Education
17.1 UNDERSTANDING THREADSAFE

QR TCB is rapidly becoming constrained

Running at 100% CPU

Every task requiring the QR TCB to be dispatched is being


delayed

Transactions waiting on the QR TCB to become available are


being delayed

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

z/OS
LPAR
cpu0 QR cpu1 L8
tcb tcb

cpu2 L8 cpu3 L9
tcb tcb

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE

Allow all Programs to execute both DB2 SQL calls and CICS API
commands on the L8/L9 TCB

Any CICS call that is not Threadsafe will cause a switch back to
the QR TCB

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

NON THREADSAFE
CICS QR TCB CICS L8 TCB
COBOL CODE

EXEC CICS RECEIVE MAP


Change
Mode
EXEC SQL SQL CALL

Change
EXEC CICS ASKTIME Mode
ABSTIME
EXEC CICS FORMATTIME

COBOL CODE Change


Mode
EXEC SQL SQL CALL

Change
EXEC CICS ASSGN Mode
EXEC CICS READ Change
COBOL CODE Mode
EXEC SQL SQL CALL
Change
EXEC CICS SEND MAP
Mode
EXEC CICS RETURN

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE
CICS QR TCB CICS L8 TCB
COBOL CODE

EXEC CICS RECEIVE MAP


Change
Mode
EXEC SQL SQL CALL
EXEC CICS ASKTIME
ABSTIME
EXEC CICS FORMATTIME
COBOL CODE

SQL CALL
COBOL CODE

EXEC CICS ASSIGN


EXEC CICS WRITEQ TS
SQL CALL
EXEC CICS SEND MAP
Change
EXEC CICS RETURN Mode

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE and OPENAPI


CICS QR TCB CICS L9 TCB

Change (program begins)


Mode EXEC CICS ASKTIME
ABSTIME
EXEC CICS FORMATTIME
COBOL CODE

EXEC CICS READ UPDATE


COBOL CODE
EXEC CICS REWRITE

COBOL CODE
EXEC CICS ASSIGN
COBOL CODE
EXEC CICS WRITEQ TS

EXEC CICS SEND MAP Change


Mode
EXEC CICS RETURN

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE

CICS/TS 3.2 File Control commands added to Threadsafe

All Local File control commands including RLS are supported

Mirror Transaction using Function Shipping not supported

CICS/TS 5.2 added support for Transient Data

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE

CICS/TS 4.2 also added more CICS commands for Threadsafe

•QUERY SECURITY
•SIGNON
•SIGNOFF
•VERIFY PASSWORD
•CHANGE PASSWORD
•SYNCPOINT

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE

The program must be reviewed before implementing Threadsafe

• EXEC CICS GETMAIN SHARED

• EXEC CICS ADRESS(CWA)

• COBOL Calls

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE
In order to implement Threadsafe (once the Application has been
reviewed and is safe), is to do the following :
• Modify the CICS Program Autoinstall Exit. One assembler
statement needs to be added to DFHPGADX
• Modify the CICS Program Autoinstall Model Program
DFHPGAIP to change the Concurrency Attribute to Threadsafe
• Define each Program ins the CICS CSD and change the
Concurrency Attribute to Threadsafe

• Ensure the Threadsafe Dynamic Plan Exit in the DB2CONN is


being used, currently it is DSNCUEXT, it should be DFHD2PXT
Access Computing Education
17.1 UNDERSTANDING THREADSAFE

THREADSAFE
CICS Definitions

RSL = YES in the SIT

RSLACCESS enabled for each File entry

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE
The CICS Trace can be an excellent place to see how Threadsafe
works

The Trace data below, shows what happens when a Non


Threadsafe API command is encountered

The switch from the Open TCB to the QR TCB to execute it can
be seen

Access Computing Education


17.1 UNDERSTANDING THREADSAFE

THREADSAFE
In the sample Trace data below, the switch is made from the L9
Open TCB to the L8 Open TCB to process the DB2 Call.

Once the Call has finished, with the Program’s definition


specifying OPENAPI, CICS switches back to the L9 TCB before
handing control back to the program

Access Computing Education


17.1 UNDERSTANDING THREADSAFE
I SYS
STATUS: RESULTS - OVERTYPE TO MODIFY
Aging( 00500 ) Oslevel(020300)
Akp( 04000 ) Progautoctlg( Ctlgmodify )
Cicstslevel(050400) Progautoexit( DFHPGADX )
Cmdprotect(Cmdprot) Progautoinst( Autoinactive )
Db2conn() Reentprotect(Reentprot)
Debugtool( Nodebug ) Release(0710)
Dfltuser(START1) Runaway( 0020000 )
Dsalimit( 07340032 ) Scandelay( 0000 )
Dsrtprogram( NONE ) Sdtran(CESD)
Dtrprogram( DFHDYP ) Sosabovebar(Notsos)
Dumping( Sysdump ) Sosaboveline(Notsos)
Edsalimit( 0104857600 ) Sosbelowline(Notsos)
Forceqr( Noforce ) Storeprotect(Active)
Logdefer( 00005 ) Time( 0001000 )
Maxtasks( 0020 ) Tranisolate(Inactive)
Memlimit(6G)
Mqconn()
Mrobatch( 001 )

SYSID=CICS APPLID=CICS

Access Computing Education

You might also like