[Info-vax] Check if a process will auto-terminate

H Vlems hvlems at freenet.de
Wed Apr 29 06:28:22 EDT 2009


On 29 apr, 12:02, "Stephen Davies" <no... at nowhere.com> wrote:
> "Joseph Huber" <joseph.hu... at NIRWANA.web.de> wrote in message
>
> news:gt7ntt$65s$1 at online.de...
>
> > The original question:
> > The reason is that I have updated a command file to spawn a subprocess
> > then
> > exit but some legacy calls to the command file already spawn the command
> > file, resulting in the sub-sub-process terminating almost immediately
> > because its parent terminates.
> > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > This happens ONLY if SPAWN/NOWAIT was used, otherwise the parent does NOT
> > terminate before @CMD exits!
>
> Within CMD there is a SPAWN/NOWAIT.
> Therefore the problem happens with both "SPAWN @CMD" and "SPAWN/NOWAIT @CMD"
> However, the legacy calls do use "SPAWN/NOWAIT @CMD"
> So if there is a way to only detect this, it might still be useful.

Would this command procedure be helpful:

$ ty s.com
$       master=f$getjpi("","MASTER_PID")
$       write sys$output f$getjpi(master,"STATE")

The output differs as a function of the way it's run:

$ @s -> CUR
$ SPAWN @S -> HIB
$ SPAWN/NOWAIT @S -> LEF

The solution is not flawless. In a multiprocessor system the third
example may well return CUR as well.
My assumption is that the third example will have a small chance to
return HIB.
Hans



More information about the Info-vax mailing list