[OpenIndiana-discuss] FD_SETSIZE

Alan Coopersmith alan.coopersmith at oracle.com
Sat May 28 16:14:43 UTC 2011


On 05/28/11 07:48 AM, Ben Taylor wrote:
> On Sat, May 28, 2011 at 10:10 AM, Apostolos Syropoulos
> <asyropoulos at yahoo.com> wrote:
>> Alan Coopersmith has posted the following in his blog:
>>
>> http://blogs.oracle.com/alanc/entry/there_i_fixed_it
>>
>>
>> The question is why FD_SETSIZE takes the value 65536 in the 64bit model?
> 
> I would assume that whoever changed did not understand the implications
> of changing FD_SETSIZE from 1024 to 65536.  Source code revision history
> may indicate why

I bet Tim Marsland had a much deeper understanding than either you or I do.
select() is a horrible API, but so much software still uses it that we're
stuck with it, and I do remember complaints before that the system couldn't
handle programs that needed more than 1024 fd's.

>> What would happen if the default value would be, say, 2048?
> 
> Sounds like a reasonable value,  and represents 64MB of cache,
> as opposed to 2G for 65536 FDs.

Most programs don't allocate 32k per FD_SETSIZE entry like xscope did.
In select masks, they just take one bit.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System




More information about the OpenIndiana-discuss mailing list