On Tue, May 22, 2012 at 02:32:08PM -0400, "Hassink, Brian" <brian.hass...@tekelec.com> wrote: > I just asked a similar question on the libevent mailing list and was told > that it currently does not. I understand libev is modeled on libevent, but > thought I'd ask here as well...
both libevent and libev support multiple threads, in slightly different ways. > The project I'm working on involves up to 2000 "active" connections. My > initial thought was that the associated read and write events would be > pending in the same event_base / ev_loop instance, and that a thread > pool would be used to handle them concurrently. Would I have each > thread in the pool invoke event_base_dispatch() / ev_run() with the same > event_base / ev_loop instance? I can only imagine that that would be quite inefficient, which is why it's not typically implemented that way. The typical way to implement this is to have one (or more) event loops per thread with one thread or so per core, or have one event loop that is passd in round-robin among multiple threads (or some variation thereof). Sometimes you also have a thread pool for other purposes, but thread pools at least double the communications overhead over the alternatives, so are usually only reasonable for long-running operations, or when you have to do something that will block. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schm...@schmorp.de -=====/_/_//_/\_,_/ /_/\_\ _______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev