On 21.10.2010 18:51, Marc Lehmann wrote:
On Thu, Oct 21, 2010 at 05:13:46PM +0300, vvvua<[email protected]>  wrote:
I have to cancel watchers, destroy the loop and free memory.
If the process itself is shutting down (exiting?) then freeing the
watchers is just wasting cpu cycles, the OS does it for you, and much
faster.
I know that but parent process isn't OS.
Yes, the parent process will not clean up for you, but the OS will do,
regardless of your parent process or not.

So the right way is:
1) To store list of pointers to watchers.
2) When the callback rises, delete the pointer from the list and
free memory.
3) At the end of the process free memory with help of list.
You can do that, but really, the OS will do it for you much faster. Big
promise :)

I mean "process" as a part of the program, not the system process (forked or cloned).


_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to