On Sep 8, 2006, at 12:13 PM, William Ahern wrote:
Ah. I was approaching it from another angle (one thread per event
loop, and
the question being how to inject events and balance events into
each event
loop).
Like the first thing I described? Have you actually done this and had
any luck with it? I suppose I could give it a go, at least for a
simple balancing scheme.
I'd never want to touch the above scheme w/ a ten foot pole, mostly
because one of the greatest benefits I enjoy with event-oriented
programming
is the lack of contention (i.e. not having to use a mutex everywhere).
I don't like the idea of losing that either, but there's no getting
around having some sort of multiprocessing if you're going to use
multiple processors, and recent hardware changes are making it harder
to justify not doing so.
There are lots of scenarios where I might have multiple events
outstanding,
all related to a single context (TCP proxying, for instance). In
the above
design, I'd have to begin littering mutexes around my code.
Relating those
oustanding events to a shared event loop implicitly frees me from
having to
deal w/ this problem.
Yeah, that's certainly true for my SSL proxy. There'd need to be some
sort of grouping of events, and I'm not sure how that should work if
a new member is reported while the event is out for delivery. Held
until next time, I guess.
--
Scott Lamb <http://www.slamb.org/>
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users