Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Apr 1997 02:08:36 +0800
From:      Peter Wemm <peter@spinner.DIALix.COM>
To:        David Nugent <davidn@unique.usn.blaze.net.au>
Cc:        freebsd-current@freebsd.org
Subject:   Re: POLL & the Single FreeBSD'r 
Message-ID:  <199704081808.CAA11077@spinner.DIALix.COM>
In-Reply-To: Your message of "Wed, 09 Apr 1997 03:23:03 %2B1000." <19970409032303.34151@usn.blaze.net.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704081808.CAA11077>