I think libevent's current multithreaded behavior is not terribly useful:

1. You can't safely share a single event_base among a pool of threads. This is actually what I'd like to do with threads, especially now that four-core systems are becoming cheap. (My SSL proxy should be able to put those extra cores to use.) It's...tricky...to get right, though.

2. If you forget event_base_set on an event, it's associated with the latest base created. This will probably work most of the time. It'd be much less confusing if it consistently broke.

3. Each new base created leaks the existing ev_signal_pair descriptors.

4. Signals are delivered to whatever event loop happens to see them first.

5. It uses sigprocmask(), which has undefined behavior when threads are in use. [1]

6. You can't destroy an event_base.

I'm not sure what the ideal thread behavior would be, though, much less how to achieve it in a backward-compatible way. Opinions?

[1] http://www.opengroup.org/onlinepubs/007908799/xsh/sigprocmask.html

--
Scott Lamb <http://www.slamb.org/>

_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to