Lindy,

The ECB= on the ATTACH is used to notify the ATTACHing program that the ATTACH'd program (a subtask) has terminated (normally or abnormally).

If you wish to synchronize the ATTACHing program with the ATTACH'd program you would pass an ECB in the plist for the ATTACH'd program using R1. I refer to this ecb as the "sync" ecb. The ATTACHing program will issue the ATTACH and then issue a WAIT on the sync ecb. The ATTACH'd program will perform inits and then POST the sync ECB when inits are complete. For example lets say you are in a loop attaching subtasks and the plist passed to each subtask is using the same memory area but you have to pass different values in the plist to each subtask. Each subtask would have make a copy of the input plist data area prior to - a simple example would be a return buffer) .

It is reasonable for any code that is going to issue a POST to check the ECB prior to issuing the POST. I believe PoPs (or POO as some folks call it) has a section on bypassing post that would be useful for you to look at.



Ray Overby



Lindy Mayfield wrote:
Thanks.  That makes sense.

What doesn't is that Cannatello's book has a page and a half on doing
POST, with one example of how to change the ECB without using the POST
macro.

He even has the child checking the ECB to see if a WAIT had been issued.

Lindy

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Wayne Driscoll
Sent: 19. tammikuuta 2008 1:39
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: How does ATTACH pass address of ECB to child?

Lindy,
The child doesn't need to know anything about that ECB.  The ECB
specified on the ATTACH macro is used by the system.  When the subtask
completes and returns to the system (via the oldest PRB on the task
queue issuing an SVC 3), the system will post the ECB to notify the
mother task that it is safe to issue the DETACH.  If the child task
POSTS the ECB, and continues to execute, when the mother wakes up and
issues the DETACH you will see x3E abends caused by terminating a TCB
that was still running.

Wayne Driscoll
Product Developer
JME Software LLC
NOTE:  All opinions are strictly my own.



-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Lindy Mayfield
Sent: Friday, January 18, 2008 5:32 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: How does ATTACH pass address of ECB to child?

I wonder if I am missing something.

Here is what I think: My main program does an
ATTACH,EP=CHILD,ECB=ECB1
WAIT ECB=ECB1
DETACH (R1)

The program CHILD does its thing and then when done

POST ECB1

Which IIUC causes the main program to stop waiting. How does CHILD know
the address of ECB1 in order to POST?  Or do I need to pass the address
as a parameter?

Lindy

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to