Why having to use non-blocking fd in a edge triggered epoll function?

前端 未结 3 650
鱼传尺愫
鱼传尺愫 2021-02-10 01:29

I read document abount edge triggered epoll function in web as follows:

1. The file descriptor that represents the read side of a pipe (rfd) is registered on the         


        
3条回答
  •  误落风尘
    2021-02-10 01:57

    I guess it's because of the semantics of edge-triggered. The edge-trigger, according to the semantics, will raise another event only once the EAGAIN has been received. In case of blocking sockets there is no EAGAIN. You could have defined it in some other way, but this how Linux defines it. In other words, If you use blocking sockets, you have no idea about when you can safely call epoll_wait.

提交回复
热议问题