R8B-0 devpoll patch

Artur Grabowski art@REDACTED
Wed Feb 27 15:21:54 CET 2002

Kent Boortz <kent@REDACTED> writes:

> > This patch implements support for /dev/poll in Solaris                
> > and /dev/epoll for Linux.                                             
> This sounds very promising. For FreeBSD there is kqueue() that
> according to some tests is even more efficient.
> Do you know how stable these extensions are?

kqueue in FreeBSD and OpenBSD (soon to be adapted by NetBSD too) is very
stable (well, actually I introduced a bug in OpenBSD-current a few weeks
ago that I'm fixing at this moment) and very useful and perform well.

Unfortunately not all files support kqueues. Pipes, fifos, regular files
sockets and ttys, as well as processes and signals, are supported, but more
weird devices like usb stuff, audio, radio, etc. are not supported. I know
that NetBSD is aiming for full support (everything that supports select will
also support kqueue) and as soon as I have some more time I will go for
full support in OpenBSD (possibly even going as far as making select(2) and
poll(2) into wrappers around kqueues). But that's worth thinking about.

Also, the full advantage of kqueues is seen if you try to move all event
handling including processes and signals into the same processing loop.
The first time I fully appreciated kqueues was when I convereted all external
event handling in inetd(8) into kqueues and realized that I just removed
thousands lines of code (including three signal handling race conditions) and
replaced them by four 10-line functions for {,de}registering events and 5
lines in the main loop.


More information about the erlang-questions mailing list