Re: FD_SETSIZE problem on Linux

From: (no name) (no email)
Date: Fri Feb 20 2004 - 11:32:50 EST


On Fri, 20 Feb 2004, Wietse Venema wrote:

> Michael Tokarev:
> > But again, this is a) a gross hack which may stop
> > working the next day and it documented nowhere,
> > and b) using select() for so many FDs is inefficient.
>
> When is select() inefficient? What if one really wants to select
> on 2048 open files, instead of just only descriptor 2047?
>

The real gain in the newer interfaces is that consecutive calls can use
exactly the old event mask, or with a specified list of changes. This
reduces the kernel overhead of updating the I/O callbacks for all the open
files. Also the kernel could already know that a pre-registered list of
files has ready descriptors. This said, most of the optimization can be
done behind select's back. Running XOR on two arrays should not be that
expensive.

-- 
	Viktor.







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD