[erlang-questions] clipping of max# of file descriptors by erts when kernel poll is enabled

Joel Reymont <>
Sat Aug 23 10:32:44 CEST 2008


Just to make sure I delivered my point across...

erl_poll.c will be compiled twice, once with ERTS_POLL_USE_KERNEL_POLL  
and once without, even when kernel poll is present and the build  
detects it.

ERTS should not be clipping max_fds when ERTS_POLL_USE_KERNEL_POLL is  
defined, not in the "kernel poll" version of erl_poll.c.

To make sure there's no clipping when kernel poll is present and  
detected, the code should look like this:

#if ERTS_POLL_USE_SELECT && defined(FD_SETSIZE) && ! 
ERTS_POLL_USE_KERNEL_POLL
    if (max_fds > FD_SETSIZE)
        max_fds = FD_SETSIZE;
#endif

I tested it by running erl +Ktrue and erl +Kfalse and it works. The  
original version clips max_fds regardless of kernel poll.

	Thanks, Joel

--
wagerlabs.com








More information about the erlang-questions mailing list