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

From: Evan Jeffrey (hobbes@utrek.dhs.org)
Date: Tue Oct 24 2000 - 17:39:15 EST


> Multiple event queues are bad, because it completely breaks the notion of
> even-driven programming. How do you want to listen to them all? You can't.
> You can only listen to one event queue at a time - unless you create some

You can listen to one event queue per thread. Maybe in the case people
always bring up (Apache handing 10000 concurrent connections), threads
are indistiguishable, but for many applications different threads or thread
groups will be assigned to different tasks. An ORB ought to be allowed
to clone off an event handler thread that doesn't have to worry about
receiving X events, which might be really slow to handle. (Or vice versa,
handling a mouse_move event shouldn't have to wait for a CORBA upcall that
recalculates a spreasheet).

Also, what happens if someone does a clone with CLONE_FILES but no CLONE_VM?
Now the event handlers and opaque data point to things that may not even be
valid in this VM.

I see a couple of ways to do this that don't give in much from the "One
event handler list per process" idea. Add a CLONE_EVENTS flag to clone. This
is rather nasty, since it violates orthogonality (since a struct event
references both VM and fd objects), and makes it difficult for pthreads users
to choose whether to share event handlers. The second is to tag events
with a threadid, and allow add_event to specify a flag saying "only deliver
to this thread" and get_events to say "wait for this threads events, or any
threads events". The third is to just declare "event handlers are shared
by any processes sharing both a VM and FILES". This seems rather silly
(since it would still have to be independant in the task_struct, but with
no user space control over it), and doensn't help the poor SOB who has
to handle

> kind of "hierarchy" of event queues, where you have one event queue that
> you wait on that contains the _other_ event queues, so that you can tell
> which one has anything pending..

Agreed. The only reason to do this is if your event queue sucks as bad
as poll() and you have to do so for effeciency reasons... (Like people do
with 10 threads each handling 1/10 of the fds).

Evan

---
Fear is the mind killer.   -- Frank Herbert, "Dune"
-
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:14 EST