Skip to content
New issue

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

疑问提出 #1

Open
JimmyLynkx opened this issue Oct 15, 2023 · 1 comment
Open

疑问提出 #1

JimmyLynkx opened this issue Oct 15, 2023 · 1 comment

Comments

@JimmyLynkx
Copy link

操作系统的IO多路复用那里,epoll的底层好像是红黑树而不是b+树?

@tmnhs
Copy link
Owner

tmnhs commented Oct 30, 2023

是的,已修改

Linux中epoll机制的底层数据结构使用的是红黑树(Red-Black Tree),而不是B+树。Epoll是Linux上用于I/O事件通知的一种高效机制,它使用红黑树来管理文件描述符(File Descriptor)和事件,以便快速地检测和响应事件状态的变化。

epoll_create() 系统调用创建的 epoll 实例内部使用的主要数据结构是一个事件表,这个事件表通常是一个红黑树(Red-Black Tree),用于高效地存储和管理要监控的文件描述符以及与之关联的事件信息。

B+树通常用于文件系统等数据存储结构,而不是用于事件通知和I/O多路复用。

感谢你的提问

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants