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 :)

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

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

Reply via email to