On Sun, Mar 02, 2014 at 08:27:53PM +0100, Nicolas Van Eenaeme <nico...@massivemedia.eu> wrote: > Do we need to stop the watchers before closing the fd, or the way around?
Before. > Since in the documentation it says for EVBACKEND_EPOLL: > "Best performance from this backend is achieved by not unregistering all > watchers for a file descriptor until it has been closed, if possible, i.e. This is correct. Still, when you close it, you have to stop the watchers first. Stopping a watcher with a bad fd is a bug. > Or doesn't it make that much difference? This comment is clearly about performanc,e not correctness. You do get the best performance by not unnecessarily stopping and starting watchers. Before closing the fd, however, you must stop all watchers. Not doing is is pretty much like clearing a memory region after it being freed. With that image in mind, the comment about performance amounts to reusing the memory area you got until you free it is best for performance. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schm...@schmorp.de -=====/_/_//_/\_,_/ /_/\_\ _______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev