[tkined] Starting Jobs

Curt Sampson (cjs@portal.ca)
Sat, 9 May 1998 01:21:28 -0700 (PDT)

I'm putting together a little network monitoring system in scotty
that sets up a separate job for each service on each host that it
monitors. These jobs run at regular intervals, and I'm very careful
to make them non-blocking; I use non-blocking I/O while waiting
for replies and, when no input is available, wait with:

proc nbsleep {secs} {
set v 0
after [expr int($secs * 1000)] {set v 1}
job schedule
if {$v == 0} {vwait v}
}

so that other jobs can run while one is waiting for input.

Unfortunately, I've run into a problem with starting the jobs. My
main program has a little loop that issues a series of `job create'
commands before it waits. It does an nbsleep of a little over a
second between the job create commands so that the network traffic
generated by this monitoring system is less bursty.

However, it appears that I can't start a job when another job is
running, even if that job is in an nbsleep. Is this indeed the
case? And, if so, is there a way to do a `job create' that doesn't
run the job instantly upon creation, but delays a bit so that I
can get all my jobs created before any of them run?

BTW, I'm also interested in opinions on how I can run external
programs and send ICMP packets without blocking the entire application.

cjs

Curt Sampson cjs@portal.ca Info at http://www.portal.ca/
Internet Portal Services, Inc. Through infinite mist, software reverberates
Vancouver, BC (604) 257-9400 In code possess'd of invisible folly.

--
!! 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.