- batch execution under Linux
- Posted by brewster on February 26th, 2004
I have an application where I need to pipe short XML scripts into a
seperate process at a given date/time. My time window is about 10
milliseconds. I'm guessing that the standard batch utilities like "at"
etc. only have one second resolution and lots of jitter around the
specified time. Are there any other utilities available that work like
"at" but with much finer timing resolution? I'd rather not write my
own if something workable is already available. I can probably deal
with the jitter seperately.
Thanks!
-Bruce
- Posted by Nick Landsberg on February 26th, 2004
brewster wrote:
Correct. Batch and at have one second resolution and a lot of
jitter.
Getting that small a resolution on what is basically a time-sharing
system is tricky, at best. (Especially since doing a
fork/exec is likely to take up a good fraction of that
10 ms.). I would consider writing that "batch" process
as a daemon which blocks on input from a named pipe or something.
When data appears in the pipe, it is "runnable" as far as
the kernel is concerned and subject to the vaguaries of the
normal scheduling algorithm.
If 10 ms. is an ABSOLULTE maximum, also consider using
some the peaudo-real-time extensions to set priorities
for the process.
Google for "real time Linux".
--
Ñ
"It is impossible to make anything foolproof because fools are so
ingenious" - A. Bloch
- Posted by BruceR on February 26th, 2004
Nick Landsberg wrote:
Thanks Nick!
I'll probably be running some form of RT extensions since part of the
system will be realtime with a 10mS heartbeat. The daemon approach seems
reasonable since it would put the scheduler in as the "timer" that
triggers execution.
The usage is fairly simple. I get a XML string with an "execution time"
element that should remain queued in a dispatcher task until the
execution time hits. At that time, the dispatcher streams the XML string
into the appropriate driver.
-Bruce
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
- Posted by Christopher Browne on February 27th, 2004
Martha Stewart called it a Good Thing when browen@yahoo.com (brewster) wrote:
You will absolutely need to implement something yourself.
I wouldn't expect "at" to have better than a 1 minute resolution.
--
let name="cbbrowne" and tld="cbbrowne.com" in name ^ "@" ^ tld;;
http://www3.sympatico.ca/cbbrowne/languages.html
You can lead a horse to water, but if you can get him to swim on his
back, you've got something.