Hmm, interesting. An fstat/sleep loop might well be sufficient. Part of the purpose of this script is to provide similar levels of support to the standard sysadmin tools at the point we replace a single error log for each webserver with lots of little logs, one for each script, so I'd hope to achieve responsiveness similar to tail -f error_log. But a second or two's delay is unlikely to be critical, and could certainly help to make the process more cooperative.
There are situations in which I'd expect large amounts of input to be filtered down to small amounts of output, but if I calculate the time to sleep from the start of the fstat/read cycle (rather than doing a fixed sleep each time) I can minimise the danger of falling behind.
Hugo
In reply to Re: Re: nonblocking I/O - testing whether file has more data to read
by hv
in thread nonblocking I/O - testing whether file has more data to read
by hv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |