I have a few threads, waiting on the same epoll_fd
with epoll_wait()
. The descriptors within epoll set are setup in this way:
struct epoll_event event;
event.events = EPOLLIN | EPOLLONESHOT;
event.data.fd = fd;
The purpose of EPOLLONESHOT
is to guarantee, that each descriptor is handled only in one thread at the same time. If one thread has received EPOLLIN
event with specific fd
, can the EPOLLHUP
or EPOLLERR
trigger event in another thread with the same fd
?
I suggest they can't - since the descriptor is disabled due to EPOLLONESHOT
. But if they can - can I use EPOLLRDHUP
instead? Will it be triggered at least once when the descriptor becomes invalid/closed/disconnected by any means?
Seems like disabled descriptors don't receive
EPOLLHUP
.