Optimal multithread model

Christophe Meessen christophe at meessen.net
Tue Mar 16 16:51:49 CET 2010

Brandon Black a écrit :
> The thing we all seem to agree on is that eventloops
> beat threads within one process, but the thing we disagree on is
> whether it's better to have the top-level processes be processes or
> threads.
I'm really not so sure about the former. The ICE system developers  
[http://www.zeroc.com] which is a CORBA like application made some 
benchmarks and concluded that the one thread per socket is the most 
efficient. It is also used in one the most efficient CORBA 
implementation omniORB [http://omniorb.sourceforge.net/].

This is probably also because the application can't be easily turned 
into an event loop program because the "callbacks" may have a long 
execution time. These would have to be turned into state machines using 
the timer to go from one state to the other. This is weird and doesn't 
seem at all more efficient than a plain basic thread. Users would 
dislike it.
My impression is that the discussion is biased by a particular use case 
pattern in mind and a focus nearly exclusive on performance.

But as you know,  when you have a hammer, everything looks like a nail ;).

Ch. Meessen

More information about the libev mailing list