4a79f182   
   From: grahn+nntp@snipabacken.se   
      
   On Thu, 28 May 2009 03:50:02 -0700 (PDT), David Schwartz wrote:   
   > On May 28, 2:53 am, reppisch wrote:   
   ...   
      
   > The 'select' API is   
   > atrocious and 'poll' is only slightly better.   
      
   ...   
      
   > You should really switch to a better socket discovery API if one is   
   > available on the OSes you support. The problem with this is that if   
   > you have 50 connections that are very inactive and one connection that   
   > is very active, you wind up making the kernel put you on 51 wait   
   > queues and then take you off 51 wait queues every time you call   
   > 'select' just to discover the one active connection.   
      
   ...   
      
   What *are* better alternatives to select() and poll(), anyway? On   
   Linux, in my case.   
      
   I've seen select(2) performance decrease in a disappointing way when I   
   selected across ~100 fds -- and that was on Linux, and my surrounding   
   code was as fast as possible (e.g. I copied the set instead of calling   
   FD_SET 100 times before each call).   
      
   "reppisch" mentioned the Linux-specific epoll(), but the man page   
   looked a bit ... unprofessional, and it wasn't clear that it would   
   scale better than select().   
      
   /Jorgen   
      
   --   
    // Jorgen Grahn R'lyeh wgah'nagl fhtagn!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|