Lindy Mayfield wrote:
I know personally that I couldn't get my head around this stuff unless I imagined some sort of application and how it would work using threads.
Assume you have a start task that is designed to service requests from VTAM terminals. With the current VTAM design, one task handles the basic VTAM interface (control blocks, exits, etc.). The mother task, when idle, waits on a list of ECBs - the task's CANCEL ECB (depending on the version of the OS, this may require authorization), the Communications ECB (to handle STOP and MODIFY operator commands), one or more work ECBs (posted by a subtask), and an STIMER ECB (required in the old days to prevent a system 522 abend if nothing much happened; also used to check for stalled processes). The mother task builds necessary control blocks, opens a log data set, etc., and establishes the VTAM interface. It then goes into a WAIT for work; a user trying to log on will drive the VTAM logon exit, which could build a request and post the work ECB.
The mother task clears the ECB, and checks the request queues. Finding a logon request, it attaches a subtask, dedicated to that terminal, that builds a screen image, etc., or it could read a data set and format it for display, or do almost anything a self-sufficient program might do. Whenever it needs something from the main task, it places a request on the appropriate queue, and POSTs the work ECB. When the request is satisfied, the mother task posts the subtask's work ECB. And the mother task would post the subtask ECB when it required an unsolicited logoff, or otherwise terminate.
Note that this design is arbitrary - there could be as many ECBs as there are request queues, there could be additional subtasks for things like writing to the log, reading data sets, etc.
One of the last things I worked on before retiring was a task much as described above, but spread over multiple address spaces. This required lots of additional validity checking, and use of (E)CSA for working areas, but even so the basic logic wasn't all that different.
Gerhard Postpischil Bradford, VT ---------------------------------------------------------------------- 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

