[erlang-questions] kpoll still using select

Sverker Eriksson sverker@REDACTED
Thu Jul 9 16:20:21 CEST 2009


Joel Reymont wrote:
> It's all coming back to me...
>
> http://erlang.org/pipermail/erlang-questions/2008-August/037574.html
> http://erlang.org/pipermail/erlang-questions/2008-August/037595.html
>
> I think it's wrong for the OTP team to hide behind broken poll on Mac 
> OSX to clip fds to 1024 when kernel poll is used. The whole point of 
> using kernel poll is to effectively manage more than 1024 descriptors.
>
> I also think it's wrong to force users to edit system header files to 
> bump the available number of file descriptors. I bumped FD_SETSIZE to 
> 30720 in /usr/include/sys/select.h (/usr/include/sys/_structs.h 
> technically) so select may choke if it falls back.
>
> I'm fine with select choking on a larger fd if it falls back. I don't 
> want any select fallbacks, otherwise I would not be using kernel poll.
>
>
Disabling fallback on select is not an option. That will fail to poll 
the tty device and make the emulator unable to read from STDIN.

To make select fail for large fd's would probably work better. But you 
will have an emulator with unstable semantics. driver_select may fail 
arbitrary depending on the value the fd happended to get. If you want 
this, you can patch erl_poll.c as suggested in the earlier thread. You 
don't have to edit any system headers.

Let's hope for a healthier poll() in the next release of OSX.

/Sverker, Erlang/OTP





More information about the erlang-questions mailing list