kqueue 有什么限制?
libev 的文档(来源)说:
Kqueue 值得特别一提,因为在撰写本文时,它在除 NetBSD 之外的所有 BSD 上都被破坏了(通常除了套接字和管道之外,它不能可靠地工作,除了在 Darwin 上,当然它完全没用) .
它还提到:
kqueue 系统调用在所有已知版本中均已损坏 - 大多数版本仅支持套接字,许多版本支持管道。
那么,kqueue 有哪些限制呢?这些限制记录在哪里?初步研究发现了旧操作系统(Mac OS X 10.3)上的内核恐慌以及对文档不正确/不完整的抱怨。我不知道这些消息来源的可靠性如何。
特别是,如果 kqueue 确实能够可靠地与套接字(AF_UNIX、AF_INET 和 AF_INET6)一起工作,那么我不介意。我对有关 Mac OS X 和 FreeBSD 实现的信息特别感兴趣。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 OS X 上,
AF_UNIX
、AF_INET
和AF_INET6
应该不会出现问题。如果您想在 OS X 上将其与 PTY 一起使用,则会遇到问题10.9,因为这些版本不支持 PTY。有证据表明,在 OS X 10.9 上,PTY 终于得到了支持。如果您尝试使用非文件描述符通知,您将开始遇到其他限制(例如,不支持 AIO)。
我不熟悉 FreeBSD 的 kqueue 实现。也许其他人可以添加一些有关它的信息。
On OS X, you shouldn't have problems with
AF_UNIX
,AF_INET
, andAF_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
在 FreeBSD 上完美运行,至少对于网络来说是这样。我已经用多达 180k 个已连接的活动套接字测试了自己的网络内容。我不知道AIO..没有测试过自己。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.