title: With a single file descriptor, Is there any performance difference between select, poll and epoll and ...?
body: <p>The title really says it all.</p>
  
  <p>The and ... means also include pselect and ppoll..</p>
  
  <p>The server project I'm working on basically structured with multiple threads.  Each
  thread handles one or more sessions.  All the threads are identical. The protocol 
  takes care of which thread will host the session.</p>
  
  <p>I'm using an inhouse socket class that wraps things up.  The point of interest is a checkread call which calls either poll (linux) or select (windows).</p>
  
  <p>In summary each thread currently calls poll on a single socket.  From what I can tell, using epoll would only be of benefit if this thread was looking at multiple sockets such as what you'd get in say an HTTP server. That's not what I'm doing in my case.  And the class only handles a single socket at a time.  </p>
  
  <p>There is some brief discussion about edge and level triggering in the man pages for epoll.  I'm not really sure what it means.   In the socket class I see an optimization in the windows part of the  code that shortcuts the select call with an ioctlsocket &amp; FIONREAD to check if there is any data.  Wondering if that would return > 0 even if a complete UDP packet hadn't arrived at the time of the call.  Is this what edge triggering is in epoll?</p>
  
  <p>In some rudimentary testing, I'm also seeing no noticeable difference between using select and poll.  </p>
  
  <p>I can see that using ppoll might be of benefit though due to greater precision in the timeout.  Any thoughts?</p>
  
  <p>And yes, I am trying to optimize throughput for a session that is receiving lots of data.  The server is more Network &amp; Disk bound than CPU.</p>