Вопрос

The documentation for libev (source) says that:

Kqueue deserves special mention, as at the time of this writing, it was broken on all BSDs except NetBSD (usually it doesn't work reliably with anything but sockets and pipes, except on Darwin, where of course it's completely useless).

It also mentions that:

The kqueue syscall is broken in all known versions - most versions support only sockets, many support pipes.

So, what are the limitations of kqueue? Where are these limitations documented? Initial research turned up references to kernel panics on older operating systems (Mac OS X 10.3) and complaints about incorrect/incomplete documentation. I don't know how reliable these sources are.

In particular, if kqueue does work reliably with sockets (AF_UNIX, AF_INET, and AF_INET6) then I don't mind. I am particularly interested in information about the Mac OS X and FreeBSD implementations.

Это было полезно?

Решение

On OS X, you shouldn't have problems with AF_UNIX, AF_INET, and AF_INET6. You will have problems if you want to use it with a PTY on OS X < 10.9, as PTYs are unsupported on those versions. There is some evidence that on OS X 10.9, PTYs are finally supported.

If you try to use the non-file descriptor notifications you will start to run into other limitations (eg AIO is unsupported).

I'm not familiar with FreeBSD's kqueue implementation. Perhaps someone else who is can add some information about it.

Другие советы

kqueue is perfectly working on FreeBSD, at least for networking. I have tested myself networking stuff with up to 180k connected, active sockets. I don't know for AIO .. haven't tested myself.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top