[svlug] select/poll and EOF

Scott Henry scotty at tenchiki.net
Fri Aug 15 00:39:09 PDT 2003

On Fri, 15 Aug 2003 05:50:35 +0000
"M. Drew Streib" <dtype at dtype.org> wrote:

> On Thu, Aug 14, 2003 at 10:44:14PM -0700, Scott Hess wrote:
> > Well, polling shouldn't be _too_ horrible, performance-wise.
> >  You're
> > looking at a tight loop of usleep/stat calls, which should
> > be pretty low overhead, so long as you're only doing it like
> > 8 or 16 times per second(fast enough for a human, but slow
> > by computer standards).
> Thanks. I think that I may just have to rely on the difference
> between human-perceived latency and computer-perceived
> latency. A poll 20 times per second may seem messy, but it
> won't wreck my machine, and humans probably won't see the
> difference, especially on network connections that have
> latency of their own.

Something else to look at is FAM (File Alteration Monitor). It was originally written for IRIX, but SGI released it as Open-Source (see somewhere on oss.sgi.com). Basically, you register interest in a file(s) (which may be a directory, too), and FAM queues events about changes to the file(s) (including file size changes). It has performance problems when watching NFS mounted files, but as I recall, there is a network form of the interface.

I don't know if it is in any standard distro, so you may have to make a custom kernel.

               More Important Drivel from:
 Scott Henry <scotty at rahul.net> /\/\/\  http://www.tenchiki.net/

More information about the svlug mailing list