[mod.computers.vax] An example RWAST process

LEICHTER-JERRY@YALE.ARPA.UUCP (03/29/87)

[The message I'm responding to showed an analysis of a process hung in RWAST.
The author says:  "The listing clearly shows that the process is out of BIO
quota....  I used a macro program to alter the PCB, and the process just
disappeared....  As the code shows, I did not call any OS routines to notify
the Scheduler of the PCB changes.  This makes me wonder whether or not
resources were being consumed.  Obviously something took note of the changes,
and freed the process from RWAST."]

I think what you saw was a an interesting "Heisenberg" effect.  Remember what
an RWAST state is:  A wait for some resource that is likely to be returned
by an AST.  Hence, whenever the process receives an AST, it will try to get
out of the wait state.

The code you wrote comes "out of the sky" and adds extra BIO quota to the
process.  Hence, should it ever receive an AST, it will find it is now OK to
proceed.  But any attempt to look at the process that invokes SYS$GETJPI will
send an AST to the process!  So the instant you look at it, the process will
be released from its slumber.  In fact, it will then quickly exit, since you
indicated that you had issued unsuccessful STOP/ID's at the process earlier -
they were still waiting to be executed, once the RWAST state finished.

(Actually, since the process was some kind of network process, it's possible
that it had various timing AST's set up, so that even if you'd left the
process alone, it would have woken up eventually.  But it's hard to tell.)

The particular action you took - given a process extra quota - is pretty safe,
or, at least, about as safe as any ad hoc kernel mode hacking can be.  Some
hacker might want to throw together a little k-mode program that would look
at a process in RWAST, figure out what quotas it had run out of, and give
it some more of them.  Not something you'd want to run on a day-to-day basis,
but it could be handy for dealing with this type of problem.  (It would
probably be safest to have the program stop the process - though I see no
reason why it could not be left to run with its new endowment, if the program
did a clean job of it.)

Any takers?
							-- Jerry
-------