I have not read the book in question, but I will often have task A
attach task B and pass a parameter list via R1 that has a pair of ECB's
in it.  One ECB for the child (task B) to wait on and one ECB for the
parent (task A) to wait on.  Also in the parameter list are some queues
that are used for scheduling work.

Task A puts work on the queue, does a POST to the ECB task B is waiting
on, and goes about doing other things.  At some time it may WAIT on the
ECB task B is going to POST when it has completed the work.

Given the above it makes sense to say that the parent (task A) or the
child (task B) is waiting on an ECB (not on the same one I hope).

The POOP has a couple of pieces of code in the appendix on FAST WAIT and
FAST POST.  If the ECB you are going to wait on is already posted there
is no need to WAIT on it.  Like-wise, if no one has issued a WAIT on an
ECB there is no need to issue a POST, just set the posted bit.  That
saves a few hundred or thousand instructions for each SVC you avoid.

As others have said, the ECB in the ATTACH is only used by the parent to
know when it can DETACH the child TCB.  To not wait on that will lead to
lots of fun.

Chris Blaicher

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

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