[usocket-devel] Re: Fwd: [usocket-cvs] r245 - usocket/trunk/backend

Douglas Crosher dtc at scieneer.com
Sun Jun 17 07:48:10 UTC 2007


Hello Erik,

>> Changing the wait-for-input-internal function to set a flag in the 
>> socket objects
>> to indicate they are ready would avoid the need to cons up a list of 
>> ready sockets
>> which can become very inefficient when managing a large number of 
>> connections.
> 
> That's true. On the other hand, the efficiency of needing to walk all
> provided socket objects to find out which ones changed seems to be the
> main objection against the select() system call (which is why poll(),
> epoll() and others have been invented, right?).

The lack of performance probably shows that the 'wait-for-input-internal
interface is too high-level - it implicitly defines a socket set as a
list and this list needs to be consed when calling and on return and
scanning the list slow.  In contrast a CL implementation with an interface
to poll() and select() can implement non-consing socket sets that have
higher performance.  The poll() function has an advantage when waiting
on only a small subset of the open sockets and select() may have an
advantage when waiting on a large set of sockets because the bit sets can
be scanned in word sized chunks.

Perhaps a portable interface to the select() and poll() functions would
be better.

Regards
Douglas Crosher




More information about the usocket-devel mailing list