cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: a curl_multi_fdset() replacement? (TODO-RELEASE #55)

From: Jamie Lokier <jamie_at_shareable.org>
Date: Mon, 31 Jan 2005 14:09:46 +0000

Daniel Haude wrote:
> Now I hear that select() isn't the way to go. I know that the discussion
> is beyond the scope of this list, but if someone could point me to the
> relevant sources of information on the Net I'd be grateful.

select() is fine except for two problems:

    1. It doesn't work with file descriptor numbers >= FD_SETSIZE.
       Typically FD_SETSIZE is 256 or 1024, but occasionally it's 32.

    2. It effectively gets slower and slower when you have thousands
       of concurrent connections over slow links.

poll() when it's available fixes the first problem but not the second.

There are other interfaces which fix the second as well, but only
select() and poll() are standard across lots of platforms.

In practice a lot of programs use select(), and its limitations aren't
a problem for them in common usage.

-- Jamie
Received on 2005-01-31