buildFdSets: file descriptor out of range

Simon Marlow marlowsd at
Thu Jul 16 05:33:26 EDT 2009

On 16/07/2009 06:53, Kazu Yamamoto (山本和彦) wrote:
> Hello,
>>> Reduce this to 1024, otherwise the runtime will eventually find itself
>>> dealing with file descriptors beyond the select() limit mentioned
>>> above.
>>> Someone with more knowledge of the Haskell runtime will have to advise
>>> as to possible ways around it if you really need more than 1024 file
>>> descriptors.
>> There's no easy workaround.  We could have the IO library switch to
>> using blocking read() calls for the out-of-range FDs to avoid the
>> error from the IO manager, but that is likely to lead to a different
>> problem: too many OS threads.
> Thank you for reply.
> I changed forkIO to forkOS. But I received the following error.
> 	ERRORCannot create OS thread.

I don't think forkOS is going to help you here.  The IO library is still 
using select(), all you're doing is making more OS threads.

We could do blocking read() for a bound thread.  That would make some 
sense, but we don't do it at the moment, and it does add an extra test 
to the code.

> I want to decrease the stack size of threads to increase the number of
> threads to be created. How can I do this?

That's an OS issue, I'm not sure.


More information about the Glasgow-haskell-users mailing list