Poll'able Queue objects.
Chris Watson
chris at voodooland.net
Sat Mar 10 19:40:31 EST 2001
As an aside. Granted this is *NON PORTABLE* and BSD specific. BSD has a
*really* cool replacement for select/poll called kqueue. It is currently
in FreeBSD and NetBSD AFAIK.
DESCRIPTION
kqueue() provides a generic method of notifying the user when an
event happens or a condition holds, based on the results of small
pieces of kernel code termed filters. A kevent is identified by the
(ident,filter) pair; there may only be one unique kevent per kqueue.
The filter is executed upon the initial registration of a kevent in
order to detect whether a preexisting condition is present, and is
also executed whenever an event is passed to the filter for evaluation.
If the filter determines that the condition should be reported, then
the kevent is placed on the kqueue for the user to retrieve.
The filter is also run when the user attempts to retrieve the kevent
from the kqueue. If the filter indicates that the condition that
triggered the event no longer holds, the kevent is removed from the
kqueue and is not returned.
<...snip...>
It scales like a fantasy :)
http://www.kegel.com/dkftpbench/Poller_bench.html
Very very nice. For those of use using BSD that is. Also Doug White wrote
a Python wrapper for kqueue. It's in FreeBSD's ports tree as Py-Kqueue.
--
=============================================================================
-Chris Watson (316) 326-3862 | FreeBSD Consultant, FreeBSD Geek
Work: scanner at jurai.net | Open Systems Inc., Wellington, Kansas
Home: scanner at deceptively.shady.org | http://open-systems.net
=============================================================================
WINDOWS: "Where do you want to go today?"
LINUX: "Where do you want to go tomorrow?"
BSD: "Are you guys coming or what?"
=============================================================================
irc.openprojects.net #FreeBSD -Join the revolution!
ICQ: 20016186
More information about the Python-list
mailing list