Re: job and fork()

clau@plaintree.com
Mon, 10 Mar 97 09:58:27 est


If I have not mistaken, the tcl interpreter is a single threaded process,
meaning the job command will work only if the individial job is short and that
they do not block. If one of them blocks indefinitely, the interpreter session
blocks (which means no other scripts in the same session will get executed).

If your job is long, I'd say use either "exec" or "ined create INTERPRETER"
under tkined (refer to man pages for exact usage). Otherwise, "job" is probably
easier.

clau@plaintree.com
Carmel Lau's personal opinion.

______________________________ Forward Header __________________________________
Subject:
Author: "D. Brian Kimmel" <briank@alki.kimbro.com> at internet
Date: 3/10/97 2:23 AM

>
> Hi, everybody !!
> Does anyone know how can I make fork() in scotty , i. e. I need to
> call a programm(or tcl script, or something ) from scotty tcl script
> so that the "farther" script won`t wait till his child returns. A just
> start some new process working on it's own and continue to do my job
> in the parent.

I think I would use a 'job' command and run the script via it.
see 'man n job' (under linux) for all the details.

snippet ...

set curr [job current]

if {$Glo(debug) > 4} {
set jobs [job info]
puts " Job List=$jobs current=[job current]"
foreach job $jobs {
puts " Job $job = [$job configure]"
}
}
# Either start a job or reset the time on the existing job
if {$curr == ""} {
job create \
-command CheckDate \
-interval [expr [GetTtm] * 1000]
} else {
$curr configure \
-interval [expr [GetTtm] * 1000]
}

add -iterations 1
to execute the script just once.

Brian

-- 
D. Brian Kimmel               Kimbro, Inc.        Voice: (206) 937-8381 
Seattle, WA  USA         http://www.kimbro.com        briank@kimbro.com 
Commercial Internet Services       briank@bb.net      http://www.bb.net

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.