Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Best practices for avoiding leak zombie processes while retaining child exit code?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joshua Maurice  
View profile  
 More options May 8 2012, 6:24 pm
Newsgroups: comp.unix.programmer
From: Joshua Maurice <joshuamaur...@gmail.com>
Date: Tue, 8 May 2012 15:24:46 -0700 (PDT)
Local: Tues, May 8 2012 6:24 pm
Subject: Re: Best practices for avoiding leak zombie processes while retaining child exit code?
On May 8, 3:10 pm, Ian Collins <ian-n...@hotmail.com> wrote:

> On 05/ 9/12 09:50 AM, Joshua Maurice wrote:

> > Actually, I have a new idea that I'm starting to like. My process
> > creation abstraction library can expose a process_detach call which
> > will add it to a global list. A single background thread will
> > periodically wake up, call nonblocking waitpid on everything in this
> > global list, and remove the terminated child pids. I like this
> > background thread more than having an extra process for each processed
> > spawned - that would be annoying to me as a user looking at the output
> > of ps and trying to figure out what needs to die vs not.

> You could have a look and see how gmake manages it child processes.

Make is perhaps a bad example. It isn't a "job server". It runs a
single "job". That is, an external cancel will cancel "the whole
process". There's no finer "jobs" in make. In this case, it's fine if
you have zombie processes for a little because the make process is
about to die, and the children will get reparented to init. The
question becomes much more interesting if you have a parent process
that is doing a bunch of independent "jobs", where you can cancel one
without affecting the other. This cancel can be either user initiated
or initiated from an internal error.

I'm just trying to write a general purpose process creation API, and
I'm wondering what I should put as the Process object's destructor, or
equivalently what function(s) should I provide for error cleanup? I'd
like to allow the user of the library to make the choice whether the
child process needs to die, whether we need to wait on it, or whether
we should "detach" and forget about it. I still guess those are all
valid strategies - I think - and I'd like to offer them all.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.