I have a multithread linux program which uses epoll(7). The epoll(7) man page says when one of its fds gets closed, this fd will be automatically removed from the epoll set. My question is what if a fd of the epoll set gets closed in one thread while the epoll set is being polled in another thread concurrently without synchronization. Will the program get corrupted or will the kernel synchronize this access automatically?
Thanks
Feng