Using libev with pthreads and one listening socket

Marc Lehmann schmorp at schmorp.de
Wed Mar 30 10:43:32 CEST 2011


On Wed, Mar 30, 2011 at 03:23:41PM +1100, Arlen Cuss <celtic at sairyx.org> wrote:
> It seems to me that the threads *do* seem to get scheduled across the
> cores (i.e. it's not a requirement that they're child processes), though
> this almost certainly varies from OS [ver] to OS [ver] (tested on Linux
> 2.6.35). Of course, I'm assuming it's going on all 4 cores judging by
> its CPU being ~350% at full speed, likewise the system load approaches
> 4.0.

Slightly offtopic: In my personal experience, Linux will always
distribute threads over available cores, whether this makes any sense
performance-wise or not (libeio for example works much faster if you pin
all threads on the same cpu).

Some other systems do indeed not do that, and in theory, POSIX threads
even have an option (scheduling scope) to ask for this behaviour, but it's
not implemented widely.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list