Re: Linux's implementation of poll() not scalable?

From: Dan Kegel (dank@alumni.caltech.edu)
Date: Tue Oct 24 2000 - 01:18:52 EST


Dan Kegel wrote:
> [kqueue is] Pretty similar to yours, with the following additions:
>
> Your proposal seems to only have one stream of available events per
> process. kqueue() returns a handle to an event queue, and kevent()
> takes that handle as a first parameter.
>
> [kqueue] uses a single call to both bind (or unbind) an array of fd's
> and pick up new events. Probably reduces overhead.
>
> [kqueue] allows you to watch not just sockets, but also plain files
> or directories. (Hey, haven't we heard people talk about letting apps
> do that under Linux? What interface does that use?)

I forgot to mention:

kqueue lets you associate an arbitrary integer with each event
specification; the integer is returned along with the event.
This is very handy for, say, passing the 'this' pointer of the
object that should handle the event. Yes, you can simulate it
with an array indexed by fd, but I like having it included.

- Dan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Oct 31 2000 - 21:00:13 EST