Am Samstag, 19. Mai 2007 22:50 schrieb Paul Alfille:
> ---------- Forwarded message ----------
> From: Brian Fahrlander <[EMAIL PROTECTED]>
> Date: May 19, 2007 7:03 PM
> Subject: Faster-than-cron polling ideas?
> To: [EMAIL PROTECTED]
>
----Schnipp----
>
> Most of the things I poll will be in the 'per minute' range, though;
> too fast for cron. And I think I've worked out a way for some small
> processes to work metaphorically like OWFS, storing values in a
> directory tree, for other processes to share when needed.
>
> What I'd like to find is something that the system clock and kick
> off every second, whether polling happens then, or not. I've never used
> interrupt-driven Unix programming, and my C experience was in 1989. Do
> you have any resources you point to folks like me, with this situation?
>
There is no need for special "interrupt driven programming" in Linux, as
Un*x -- in opposition to DOS -- is a multi-tasking OS by nature. It handles
*all* tasks as "interrupt-driven".
Set up a shell script with an endless loop, poll, sleep a second, poll ...
Other tasks will run during the sleeping automatically.
myscript.sh:
===========
#!/bin/sh
while :
do
poll_ow_sensors...
sleep 1
done
$ chmod 755 myscript.sh
If you start that script in the background,
$ ./myscript.sh &
the controlling shell won't wait for the myscript.sh process to end, but
immediately continue with a new prompt.
$
Kind regards
Jan
--
Your fault: core dumped
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers