Re: evecv/memory leak




"bill pursell" <bill.pursell@xxxxxxxxx> wrote in message
news:1135722658.189541.120590@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

> The question is: is this identical to killing the process and
> restarting? Basically, I'm trying to avoid using the proprietary
> free() calls...does this accomplish that safely?

I recommend having your process 'fork' as early as possible. The parent
should just wait until the child dies, in which case it should loop and
'fork' again. The child should do the actual work. This is the safest way.
Also, if the parent can detect some problem with the child, it can kill it
and loop around to 'fork' again.

DS


.



Relevant Pages

  • Re: timing a fork
    ... if ($kid) { ... What it does is say that the parent isn't interested in ... Once a parent process has forked it can carry on on its own while the child ... In fact what a call to 'system' does is to fork a child ...
    (perl.beginners)
  • Re: File handle re-use woes using pipe within a loop
    ... > child will die before the parent has read the output from it. ... > definitions within the while loop. ... The whole point of 'my' variables is that when they go out of scope ...
    (comp.lang.perl.misc)
  • Re: non-standard functions in libc -- bad design?
    ... reliably distinguish between the parent and child processes. ... fork() returns 0 in the child, the child pid in the parent, and -1 if it ... Note that the GNU OS with its GLIBC has specific problems... ...
    (comp.unix.programmer)
  • Re: fork defunct process, already forked twice
    ... // in parent, parent waits for child to exit ... //output a fork error message; ...
    (comp.unix.questions)
  • Re: SCM_RIGHTS passes bad socket descriptor
    ... >> the parent after the first fork? ... release heap memory ... was allocated before the fork(). ... parent exits and when the child exits. ...
    (comp.os.linux.development.apps)