[racket] adding other objects to custodian

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Sun Jul 4 21:08:33 EDT 2010

On Sun, Jul 4, 2010 at 6:45 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sun, 4 Jul 2010 16:26:21 -0400, Eli Barzilay wrote:
>> On Jul  4, Matthew Flatt wrote:
>> > [...]
>> >
>> >  * A subprocess can create any number of sub-subprocesses itself, and
>> >    there's no way to kill those, which isn't very custodian-like.
>>
>> Isn't a process group the way to solve this?
>
> My impression from looking into this before was that process groups
> don't help. Can't a subprocess just declare itself to be a new process
> group (and there's no hierarchy)?

>From the wikipedia article on process groups:

"Process groups are themselves grouped into sessions. Process groups
are not permitted to migrate from one session to another, and a
process may only create new process groups belonging to the same
session as it itself belongs to. Processes are not permitted to join
process groups that are not in the same session as they themselves
are." I can't figure out if you can send a signal to every process
group in a session, but you could emulate that (maybe) by iterating
over all the processes.

However, you can't ever be guaranteed to kill all the subprocesses,
regardless of process groups.  The subprocess could be setuid, and
thus unkillable by the original Racket process.

>From a best effort perspective, I think sending the signal to the
process group is more custodian-like.
-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.