ProcessReaper: single thread reaper (original) (raw)

Martin Buchholz martinrb at google.com
Wed Apr 9 17:05:30 UTC 2014


Here's a practical (but untested) simple improvement: don't set SIGCHLD unless it's already set to SIG_IGN. Please take ownership.

--- a/src/solaris/native/java/lang/UNIXProcess_md.c +++ b/src/solaris/native/java/lang/UNIXProcess_md.c @@ -108,7 +108,8 @@ /* There is a subtle difference between having the signal handler * for SIGCHLD be SIG_DFL and SIG_IGN. We cannot obtain process * termination information for child processes if the signal

@@ -124,11 +125,15 @@ * http://www.pasc.org/interps/unofficial/db/p1003.1/pasc-1003.1-132.html */ struct sigaction sa;

}

static void*

On Wed, Apr 9, 2014 at 10:02 AM, Martin Buchholz <martinrb at google.com>wrote:

On Tue, Apr 8, 2014 at 11:08 PM, Peter Levart <peter.levart at gmail.com>wrote: Hi Martin, As you might have seen in my later reply to Roger, there's still hope on that front: setpgid() + wait(-pgid, ...) might be the answer. I'm exploring in that direction. Shells are doing it, so why can't JDK? It's a little trickier for Process API, since I imagine that shells form a group of processes from a pipeline which is known in-advance while Process API will have to add processes to the live group dynamically. So some races will have to be resolved, but I think it's doable. This is a clever idea, and it's arguably better to design subprocesses so they live in separate process groups (emacs does that), but: Every time you create a process group, you change the effect of a user signal like Ctrl-C, since it's sent to only one group. Maybe propagate signals to the subprocess group? It's starting to get complicated...



More information about the core-libs-dev mailing list