Hello Chris,

* Chris Jones wrote on Sat, Jan 24, 2009 at 06:36:32PM CET:
> Given a bash script that runs an infinite loop such as:
> 
>   do forever:
>     get data
>     print data
>     sleep 1
>   done
> 
> I was wondering if I could avoid the overhead of starting and
> terminating the sleep child process by using a different strategy. 

Try not polling, but just waiting for the producer of the data to be
ready.  Maybe your script can read a token (or the data itself) from a
pipe, and the producer write to the pipe?

Cheers,
Ralf


Reply via email to