From owner-freebsd-current Tue Apr 8 11:08:58 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id LAA21462 for current-outgoing; Tue, 8 Apr 1997 11:08:58 -0700 (PDT) Received: from spinner.DIALix.COM (root@spinner.dialix.com [192.203.228.67]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA21456 for ; Tue, 8 Apr 1997 11:08:52 -0700 (PDT) Received: from spinner.DIALix.COM (peter@localhost.DIALix.oz.au [127.0.0.1]) by spinner.DIALix.COM (8.8.5/8.8.5) with ESMTP id CAA11077; Wed, 9 Apr 1997 02:08:37 +0800 (WST) Message-Id: <199704081808.CAA11077@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: David Nugent cc: freebsd-current@freebsd.org Subject: Re: POLL & the Single FreeBSD'r In-reply-to: Your message of "Wed, 09 Apr 1997 03:23:03 +1000." <19970409032303.34151@usn.blaze.net.au> Date: Wed, 09 Apr 1997 02:08:36 +0800 From: Peter Wemm Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk David Nugent wrote: > > I implemented an openbsd-style implementation of poll() some time ago > > but it was mixed up in the middle of the upages stuff so it lot left. > > Since then, NetBSD have done a much better implementation, I'm very tempted > > to back out what I've done and start from scratch while looking at the > > NetBSD method. Basically, OpenBSD implemented poll() as an alternative > > interface to the select hooks in the kernel which means that poll() is > > limited to what select() can test for. NetBSD did it a lot better, by > > replacing the select hooks by poll hooks, and updating both front-ends to > > use the new poll backend. The main difference is that under NetBSD, you > > can poll for (say) ugent data on a socket as opposed to merely "readable". > > Interesting. Does "urgent data" include, say, an {m,c,a}time > change on a file descriptor? If not, could it be implemented? No, but if we use a poll-style backend, we can define it. > I'm guessting that "urgent data" in this context has the same > meaning with a socket with respect to tcp/ip transactions (ie. > OOB data), but the hook for poll() I'm suggesting would be > perfect for a process that sits and waits for updates or > accesses to a disk file. Processes that currently do that have > to either use alarm() or call select() with a timeout, and > both are fairly sloppy in terms of virtual memory usage. Oh, what a pleasant thought! :-) poll() a directory waiting for something to put a file in there without having to wake up every so-many seconds and stat the dir (as cron does). poll() a file to see time or size changes, eg: do what tail -f does without having to sleep and re-read every so often.. Hmm.. wasn't something like this in ITS? It's print spooler was supposedly automatically woken when a file was placed in the queue directory. > Regards, > > David Nugent - Unique Computing Pty Ltd - Melbourne, Australia > Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet > davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/ Cheers, -Peter