InSocket: Use epoll instead of select

Chris Miller chris at dprogramming.com
Thu Jan 11 05:49:16 PST 2007


On Thu, 11 Jan 2007 08:07:01 -0500, chmike  
<christophe_no_spam at meessen.net> wrote:

> Hello,
>
> I am considering using D for an ORB like application and I am confused  
> about
> Socket class providing select. select is known for years to be  
> inefficient.
> Various solutions have been proposed to solve this and the later one  
> (epoll)
> is the most efficient one.
>
> D should really consider moving to epoll API. I am using epoll for my  
> server
> applications.  To keep my code portable on windows I wrote the three  
> epoll API
> calls wrapping use of select inside.
>
> select requires to poll sockets for event, where epoll returns a list of
> socket that had an event. The effort with select is proportional to the  
> number
> of sockets regardless of their activity. With epoll it is proportional  
> to the
> effective activity. idle connections don't waste CPU. epoll scales very  
> well.
>

It was known that select() is pretty inefficient, but was provided because  
it's most portable and something to get your project going. Alternatives  
were considered but not yet pursued.



More information about the Digitalmars-d mailing list