Open Menduist opened 2 years ago
Closing IOCP port or EPOLL/KQUEUE file descriptor do not closes all the files/sockets/pipes which was registered with it. So with this PR the only resource you are cleaning is IOCP port or EPOLL/KQUEUE file descriptor - nothing more. Your PR do not even check if there some descriptors registered in IOCP/EPOLL/KQUEUE.
I would argue that the sockets the user opened are to be closed by the user
We can imagine that a user does something where he opens a socket on one thread, and then switch its processing to another thread, so we shouldn't close it if he stops the first thread
Of course, but i think the main idea of calling poll()
in loop is to allow thread to get into state when there is no more unreleased resources except IOCP
and KQUEUE/EPOLL
data structure and descriptor.
When a thread finishes, there is currently no way to release the resources of the dispatcher. Which on linux, include a FD & relatively big buffer for
epoll
We could use
onThreadDestruction
to call "close" automatically, but that raises questions in what to do with pending futures