> I have an SRB that is scheduled to run in a target address space. The SRB > attempts to determine the status (wait, active and ready) of all TCBs from > job step down. The SRB holds the local lock before attempting to check the > status. I'm trying to figure out a couple of things: > > 1) How can the SRB determine if the TCB is ready to execute (i.e. > dispatchable)? > > 2) What other things besides the TCBACTIV bit, must be tested in order to > know if a TCB is active?. I found an old post (cached on Google from IBM- > MAIN dated 10Sep1999) that says the following... > ..."Don't assume anything about TCBACTIV. The entire picture of a task's > dispatchability is incredibly volatile and (paraphrasing Alice) you have > to > look at several unbelievable things at once to get the full picture. > Fortunately the dispatcher is the only guy who really needs to and he's > twisted anyway "...
Unfortunately, it's like Einstein's cat. You can only know the state of the system by observing it and in making the observation you gain some information and lose other information. You literally cannot know for sure and there is no lock you can hold to prevent the state from changing on other cpus while you're dinking around. Even the dispatcher doesn't have that power. At best you can determine by sampling each of the cpus to see whether a TCB of interest is dispatched on that cpu at the time you looked - which is essentially tourist information because the state may have changed on the next clock cycle. If you were trying to make some sort of statistical determination (which is what certain monitoring products actually do btw) then you might get something of value, but if you wanted a deterministic answer then forget it. The comments you referenced (above) are correct. What is so important that you (think you) need to know about the dispatchability of ANY unit of work (TCB or SRB) other than your own? CC ---------------------------------------------------------------------- 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

