What is the order in which File Descriptors in epoll are returned?

▼魔方 西西 提交于 2019-12-01 18:11:37

The man page does not say anything specifically about the order, so it probably would not be a good idea to depend on the order when you call it. Even if they were returned in order in one implementation, they might not be in another. It would be best to assume that they could be returned in any order.

Just think about it logically. Presumably they're not all marked as readable as a single atomic operation, and epoll_wait might then just as well just return 1 fd available each time it's called. It makes no sense to depend on the order of it's output.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!