At 08:43 -0700 on 05/05/2012, Charles Mills wrote about Multiple
waiting tasks, one control block?:
I have a situation in which it would be a wonderful thing if I could have
multiple tasks waiting for a single event, without having a separate "wait
control block" of some sort for each task.
Why? I have no control over what the tasks "have" in advance (system exit
situation) and doing a GETMAIN or the like so that each task could have its
own ECB, and then chaining them all together, following the chain with
POSTs, FREEMAINs, etc., etc., would be a real pain, a lot of overhead, and a
real risk of mucking it up.
I know WAIT/POST/ECB does not support multiple tasks waiting on a single
ECB.
I guess that EVENTS does not support this either -- but I don't see it
explicitly in the documentation -- is my assumption correct?
Is there any other way to do this? Some clever use of ENQ or something like
that? Some other z/OS "wait" service besides WAIT and EVENTS?
Thanks,
Charles
If what you want is to have a number of tasks wait until some event
occurs and once it does to have all of them resume operation
independent of each other then ENQ can be used for this signalling.
You have the signaling task do an Exclusive ENQ. The others do Shared
ENQs. Once the signaling task does the DEQ all the waiting tasks will
get dispatched. Note that this requires that the signaling task have
done its ENQ before the waiting tasks do theirs (and thus go into a
wait state waiting on the DEQ).
Another way to use WAIT/POST is to have each waiting task know the
location of a single ECB. Initially it is set to show that no post
has yet been done on it. Until you want the tasks to go into a wait
until the "POST" is done, you it set to look like a WAIT has been
done on it. You later you do the actual POST. The waiting tasks are
in a loop. They check the status of the "ECB" and if not yet posted,
do a STIMER WAIT and then loop back to the ECB Status Check. Once the
ECB has been posted they go on and do what they were waiting to do.
Note that you are not actually using WAITs but only periodically
checking the state of the ECB.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN