| re: .0
I haven't heard of anyone doing anything like that RUN/DET/OUT=WSxn:
type command. Here is the command file I use and I run EVERYTHING
detached. So with this command file I just set up a symbol like
$ DET*ACH = "@DECW$DETACH.COM"
and then to run something like bookreader I do a
$ DET "Bookreader" "run sys$system:decw$bookreader"
This is how I start all my decwindows process from my DECW$LOGIN.COM
file so I don't have to slow down or use up CPU time for the session
manager. I like each entity to get its own time slice instead of being
in a subprocess.
Sean
$!
$! Start a detached process
$!
$! p1 = process name
$! p2 - p8 = dcl command
$!
$ u = f$cvtime()
$ y = f$extract(0,10,u)
$ t = f$extract(11,2,u)+f$extract(14,2,u)+f$extract(17,2,u)+f$extract(20,2,u)
$ cr[0,8] = 13
$ lf[0,8] = 10
$ crlf = cr+lf
$ node = f$trnlnm("sys$rem_node")-"::"
$ comfil = y+"-"+t+".tmp;1"
$ open/write q 'comfil'
$ write q "$ delete ''comfil'"
$ if node .nes. ""
$ then
$ write q "$ set display/create/node=''node'"
$ else
$ write q "$ set display/create/transport=local"
$ endif
$ write q "$ ''p2'"
$ if p3 .nes. "" then write q "$ ''p3'"
$ if p4 .nes. "" then write q "$ ''p4'"
$ if p5 .nes. "" then write q "$ ''p5'"
$ if p6 .nes. "" then write q "$ ''p6'"
$ if p7 .nes. "" then write q "$ ''p7'"
$ if p8 .nes. "" then write q "$ ''p8'"
$ write q "$ exit"
$ close q
$ delay = (f$extract(0,1,p1) .eqs. "*")
$ prcnam = f$extract(0,16,"''p1'")
$ if delay then prcnam = f$extract(1,15,prcnam)
$ define/user sys$output nl:
$ define/user sys$error nl:
$ run sys$system:loginout/detach/authorize/output=nl:/error=nl: -
/proc="''prcnam'"/input='f$search(comfil)'
$ if $severity .ne. 1 then -
write sys$output "%RUN-F-PROCNOGO, Process ''prcnam' not started", -
crlf,f$messa($status)
$ if delay then @vue$library:decw$idle "''prcnam'"
$ exit
|
| re: .-1
Here is DECW$IDLE.COM. The * as the first character of the process
name tells the DECW$ILDE.COM to watch for that process to stop page
faulting and using CPU time.
Sean
$!
$! Wait for process to become idle
$!
$! p1 = process name
$!
$ set noon
$ on control_y then goto exit
$ prcnam = "''p1'"
$ set message/nofacility/noidentification/noseverity/notext
$find:
$ p = f$pid(i)
$ if p .eqs. "" then goto exit
$ if f$getjpi(p,"prcnam") .nes. prcnam then goto find
$idle:
$ j1 = f$getjpi(p,"cputim")
$ if $severity .ne. 1 then goto exit
$ j2 = f$getjpi(p,"pageflts")
$ j3 = f$getjpi(p,"dirio")+f$getjpi(p,"bufio")
$ wait 00:00:03
$ if f$getjpi(p,"state") .eqs. "COM" then goto idle
$ k1 = f$getjpi(p,"cputim")
$ k2 = f$getjpi(p,"pageflts")
$ K3 = f$getjpi(p,"dirio")+f$getjpi(p,"bufio")
$ if j1 .ne. k1 .or. j2 .ne. k2 .or. j3 .ne. k3 then goto idle
$exit:
$ set message/facility/identification/severity/text
$ exit
|