I *think* the latter. I seem to recall that exits don't get re-entered. Not
an expert.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On
Behalf Of John McKown
Sent: Friday, November 29, 2013 4:58 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Curiosity: ETXR exit code (ATTACHX macro)

Suppose that I have a program which is heavily multitasking. There is the
parent task and multiple subtasks, all direct children of the single parent.
The ATTACHX macro uses the ETXR parameter, which specifies a single routine
which does housekeeping of some sort. Also assume that the subtasks are
being created and ending "randomly". That is the main task is "doing its
thing", then a subtask ends and drives the ETXR code under the parent TCB (I
think under an IRB). Now this can happen anywhere in the parent's "main
loop", so I know that I need to serialize properly between the "main loop"
code and the ETXR code. Assume that I have done so. I am wondering if a
second child terminates while the parent TCB is in the ETXR code for a
child, will the ETXR code be interrupted and "redriven" for the newly
terminating child TCB. Or does RTM itself serialize the ETXR code so that a
second instance is not driven until the first instance finishes (by exiting,
thus going back to the parent's "main loop").

I.e. can the RB chain at some point look like:

PRB of parent, IRB of ETXR #1, IRB of ETXR #2, IRB of ETXR #3 for a time
line like:

main TCB loop running
child #1 ends, ETXR#1 starts running on main TCB child #2 ends, ETXR#2
starts running on main TCB (EXTR#1 interrupted)
ETXR#2 ends, ETXR#1 resumes where it left off
ETXR#1 ends, main TCB code loop resumes from where it was interrupted.

or is the second ETXR "deferred" until the previous invocation does an SVC
3 to return to the main routine. Timeline like:

main TCB loop
child ends, causing ETXR to be invoked on main TCB child ends while ETXR
active, is queued ETXR #1 ends queued ETXR starts execution ETXR #2 ends
main TCB loop resumes


I think the former. with ETXR#2 interrupting ETXR#1 is what really happens.
I can't think of a way, off hand to test this.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to