gpt4 book ai didi

linux - 如果多个线程 epoll 在同一个套接字上等待怎么办?

转载 作者:太空宇宙 更新时间:2023-11-04 12:36:09 25 4
gpt4 key购买 nike

如果多个线程 epoll 在同一个套接字上等待怎么办?在我自己的实验中,它显示只有一个线程可以成功调用 epoll_wait,其他线程显示 Invalid arguments 错误。谁能解释一下?

最佳答案

您可以在多个线程上为同一个 epoll_fd 同时调用 epoll_wait。

  event.events = EPOLLIN | EPOLLET | EPOLLONESHOT;

http://www.csh.rit.edu/~rossdylan/presentations/EpollMT/

关于linux - 如果多个线程 epoll 在同一个套接字上等待怎么办?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41733436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com