epollet

What is the use case for EPOLLET?

谁说我不能喝 提交于 2020-01-06 03:34:09
问题 epoll in edge trigger mode is a strange beast. It requires the process to keep track of what the last response for each monitored FD is. It mandates the process to handle, without fail, each and every event reported (or else we might think that an FD is not reporting anything whilst it is, in fact, muted by the edge trigger behavior). When does it make sense to use epoll this way? 回答1: The main use case for EPOLLET that I'm aware of is with micro-threads. To recap - user space is doing

TCP: When is EPOLLHUP generated?

巧了我就是萌 提交于 2019-12-21 02:33:07
问题 Also see this question, unanswered as of now. There is a lot of confusion about EPOLLHUP , even in the man and Kernel docs. People seem to believe it is returned when polling on a descriptor locally closed for writing , i.e. shutdown(SHUT_WR) , i.e. the same call that causes an EPOLLRDHUP at the peer . But this is not true, in my experiments I get EPOLLOUT , and no EPOLLHUP , after shutdown(SHUT_WR) (yes, it's counterintuitive to get writable , as the writing half is closed, but this is not

One-shot *level*-triggered epoll(): Does EPOLLONESHOT imply EPOLLET?

六月ゝ 毕业季﹏ 提交于 2019-12-06 04:47:19
问题 Is it possible to use epoll in one-shot level -triggered mode? I couldn't find any information on it when I searched; it seems everyone uses edge-triggered mode. 回答1: When the EPOLLONESHOT flag is selected and you have pulled an event for a socket, then the socket won't get removed from epoll as many think but its events get disabled. You can enable them again using epoll_ctl / EPOLL_CTL_MOD . An example case when the EPOLLONESHOT behavior comes handy is when you've read the available data

One-shot *level*-triggered epoll(): Does EPOLLONESHOT imply EPOLLET?

蓝咒 提交于 2019-12-04 09:08:31
Is it possible to use epoll in one-shot level -triggered mode? I couldn't find any information on it when I searched; it seems everyone uses edge-triggered mode. When the EPOLLONESHOT flag is selected and you have pulled an event for a socket, then the socket won't get removed from epoll as many think but its events get disabled. You can enable them again using epoll_ctl / EPOLL_CTL_MOD . An example case when the EPOLLONESHOT behavior comes handy is when you've read the available data from a socket into a buffer. That buffer would be emptied independently, but until it isn't empty, you have to