InSocket: Use epoll instead of select

Lars Ivar Igesund larsivar at igesund.net
Thu Jan 11 05:29:52 PST 2007


chmike 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.

Tango will when released, provide a Selector interface that provide the most
efficient ways to do non-blocking IO on the different platforms, including
epoll where available.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi
Dancing the Tango



More information about the Digitalmars-d mailing list