【问题标题】:what is the difference between EPOLL File descriptor and event file descriptor?EPOLL 文件描述符和事件文件描述符有什么区别?
【发布时间】:2014-11-26 11:20:57
【问题描述】:

我在线程中将 EPOLL 和 eventfd 用于 IPC,但我没有得到参数 epoll 文件描述符和事件文件描述符之间的差异

你能详细说明一下吗...

谢谢。

【问题讨论】:

    标签: linux pthreads epoll


    【解决方案1】:

    epoll 文件描述符:系统调用:

          int epoll_create1(int flags);  
    

    返回epoll 文件描述符,也称为efd。该描述符用于轮询(epoll_wait)和控制(epoll_ctl)命令。

    事件文件描述符:普通套接字 fd 从 socketaccept 返回,就像系统调用知道为 event 文件描述符一样。这些文件描述符是设置事件,如EPOLLINEPOLLOUTEPOLLET 等。

    事件文件描述符在事件文件描述符上注册或绑定,用于轮询事件。

    【讨论】:

      猜你喜欢
      • 2014-04-25
      • 2011-01-26
      • 2011-06-18
      • 1970-01-01
      • 2014-11-07
      • 2012-01-01
      • 2017-04-13
      • 2014-12-20
      • 2016-10-19
      相关资源
      最近更新 更多