We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
struct epitem { RB_ENTRY(epitem) rbn; /* RB_ENTRY相当如定义了如下的一个结构成员变量 struct { struct type *rbe_left; //指向左子树 struct type *rbe_right; //指向右子树 struct type *rbe_parent; //指向父节点 正常的红黑树没有父节点,这里为什么需要? int rbe_color; //该红黑树节点颜色 } rbn*/ };
epoll add 是向红黑树中添加节点 epoll wait 是将红黑树中就续的文件节点, 添加到双向链表中, 返回给应用,这个添加到链表中的操作,是内核完成,还是自己实现呢? 将一个fd添加到epoll中,底层的epoll是如何判断这个fd是否有数据可读,是否可以写数据,请问这样的判断是否消耗很大呢? 请问我理解的正确吗?
The text was updated successfully, but these errors were encountered:
你好,关于epoll与红黑树的关系,epoll数据可读可写的实现。 https://zhuanlan.zhihu.com/p/50984245
Sorry, something went wrong.
No branches or pull requests
epoll add 是向红黑树中添加节点
epoll wait 是将红黑树中就续的文件节点, 添加到双向链表中, 返回给应用,这个添加到链表中的操作,是内核完成,还是自己实现呢?
将一个fd添加到epoll中,底层的epoll是如何判断这个fd是否有数据可读,是否可以写数据,请问这样的判断是否消耗很大呢?
请问我理解的正确吗?
The text was updated successfully, but these errors were encountered: