Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Threadsafety for Started tasks.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Tue Nov 10, 2009 5:29 pm    Post subject: Threadsafety for Started tasks.
Reply with quote

Hi,

ProgA - defined as Quasirentrant
ProgB - defined as Threadsafe

ProgA Links/XCTLs ProgB.

Even though ProgB is threadsafe, it will run as a Quasirentrant only, because the calling program's TCB affinity takes precedence.

Now my question is,

if ProgA 'starts' a transaction TRNB, which invokes ProgB. Then will ProgB run as Threadsafe ?

I have searched for information in the 'Threasafe Considerations' redbook, but i couldn't find any info on started transactions.
So pls help.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 11, 2009 5:25 am    Post subject: Reply to: Threadsafety for Started tasks.
Reply with quote

If PROGB is accessed via a LINK-API from PROGA and PROGB is defined as Threadsafe in the PPT, then it will execute on an L8 TCB. However, if PROGB contains non-Threadsafe CICS API's, then each time they are invoked, control is returned to the QR for execution and once the API has completed, control is then returned back to the L8. A round-trip TCB switch is about 4,000 instructions, but you would want to limit these switches as much as possible. Ideally, if PROGB is fully Threadsafe compliant, then it should start and end on an L8. Regardless, when PROGB issues a RETURN, control is returned to PROGA, executing on the QR.

These same rules hold true for an XCTL-API but control goes to the Next program or a RETURN is issued, whatever the case may be.

If PROGA were to CALL PROGB (not a LINK-API), then yes, PROGB takes on the PPT characteristics of PROGA and will execute in the QR.

If PROGA were defined as Threadsafe (executes on an L8) and PROGA CALLS PROGB and PROGB is not Threadsafe compliant, then you might raise some "opportunities" for yourself. icon_eek.gif

What version/release of CICS are you running?

Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 11, 2009 5:39 am    Post subject: Reply to: Threadsafety for Started tasks.
Reply with quote

Here's a helpful Link -

http://www.redbooks.ibm.com/abstracts/sg246351.html?Open

Entitled "Threadsafe Considerations for CICS".

It is downloadable as a PDF....

Bill
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Wed Nov 11, 2009 8:34 am    Post subject:
Reply with quote

Hey Bill... hope you don't mind an "out fo the blue" thanks... your answers are always interesting and helpful
Back to top
View user's profile Send private message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Wed Nov 11, 2009 1:09 pm    Post subject: Reply to: Threadsafety for Started tasks.
Reply with quote

Bill,

Thanks for the reply.

I have verified that my program has only threadsafe CICS commands and the program logic is threadsafe too. I have changed the concurrency to Threadsafe, but still it performs a TCB switch to the QR TCB at the end of each EXEC SQL, instead of staying in the L8 TCB. I suspect that there is a non-threadsafe DB2 user exit ( TRUEs ). I will have to switch on the AUX trace and see the what really happens.

Raj
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Nov 11, 2009 4:34 pm    Post subject: Reply to: Threadsafety for Started tasks.
Reply with quote

In your DB2CONN definition, what's the PLANEXITNAME you're using? IBM furnishes two different versions; DFHD2PXT (Threadsafe) and DSNCUEXT (Quasireentrant), with DSNCUEXT being the IBM default.

Unless you need customization done to your exit, either one can be used as-is without modifications. However, DFHD2PXT is the one you should use for Threadsafe and it's defined as such in its PPT entry.

Bill
Back to top
View user's profile Send private message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Thu Nov 12, 2009 5:22 pm    Post subject: Reply to: Threadsafety for Started tasks.
Reply with quote

Bill,

The Planexitname is blank which means a default exit must be used. But in the AUX trace I couldn't find a call to either of the programs you had mentioned.

Surprisingly, at the end of the DB2 call, there is a call to a user-exit program belonging to a third party debugging application. This program is non-threadsafe and this has forced the switch to the QR TCB at the end of the DB2 call.

We have analysed the AUX log in a higher Test region where this third party application is not available. The log shows that there is no TCB switch after the DB2 call and the program continues in L8 TCB. icon_biggrin.gif

Thanks a lot for your heads up Bill !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Controlling usage of resources by tasks raja1128 CICS 3 Fri Nov 06, 2015 9:53 am
No new posts CICS ENQ RESOURCE - Multiple Tasks - ... mak_tcs CICS 2 Fri Jul 17, 2015 2:29 pm
No new posts finding the taskid for a started tran... deepa12 CICS 2 Thu Aug 07, 2014 9:06 pm
No new posts Started Tasks. gylbharat JCL & VSAM 4 Thu Jul 31, 2014 8:33 pm
No new posts Can Started Task be assigned message ... mjadwani2785 JCL & VSAM 3 Tue Nov 26, 2013 2:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us