[erlang-questions] kpoll still using select

Joel Reymont joelr1@REDACTED
Thu Jul 9 12:46:26 CEST 2009


It goes like this...

Breakpoint 2, erts_poll_init_kp () at sys/common/erl_poll.c:2174
2174	    max_fds = sysconf(_SC_OPEN_MAX);

reakpoint 3, erts_poll_init_kp () at sys/common/erl_poll.c:2183
2183		max_fds = FD_SETSIZE;
(gdb) p max_fds
$1 = -1

kernel poll is enabled with kqueue (as per configure), thus the _kp  
suffix.

ERTS_POLL_USE_SELECT is still defined, though, thus the clipping.

I have a strange feeling of deja vu, having had looked into this last  
year.

I remember that ERTS_POLL_USE_SELECT must be defined because kernel  
poll may fall back to select under certain exceptional circumstances.  
I don't understand why I'm forced to 1024 fds under normal kernel poll  
conditions, though.

Any explanation or workarounds?

	Thanks, Joel

---

2171	#if defined(VXWORKS)
2172	    max_fds = erts_vxworks_max_files;
2173	#elif !defined(NO_SYSCONF)
2174	    max_fds = sysconf(_SC_OPEN_MAX);
2175	#elif ERTS_POLL_USE_SELECT
2176	    max_fds = NOFILE;
2177	#else
2178	    max_fds = OPEN_MAX;
2179	#endif
2180	
2181	#if ERTS_POLL_USE_SELECT && defined(FD_SETSIZE)
2182	    if (max_fds > FD_SETSIZE)
2183		max_fds = FD_SETSIZE;
2184	#endif
2185	
2186	    if (max_fds < 0)
2187		fatal_error("erts_poll_init(): Failed to get max number of  
files: %s\n",
2188			    erl_errno_id(errno));

---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont



More information about the erlang-questions mailing list