Indeed, it is possible to just use the 'parent death' signal from prctl()
for this purpose.
Once (not so long ago...), when Tim Wragg was working on pthread
enhancements,
we tried out a (tricky) method which made the manager thread the parent of
all
other threads in the process (including the main thread); after this, if the
manager
failed, other threads got a signal (which they invited via prctl()) and
died.
----- Original Message -----
From: Richard Gooch <rgooch@ras.ucalgary.ca>
To: Pavel Krauz <xkr@nettest.dk>
Cc: <linux-kernel@vger.rutgers.edu>; <torvalds@transmeta.com>
Sent: Tuesday, February 15, 2000 21:38
Subject: Re: CLONE_KILLVMCH flag proposal
> Pavel Krauz writes:
> > Hello
> >
> > I am trying to modify pthread library a way in which it would not
> > need manager thread. It seems that it is pretty feasible with
> > CLONE_PARENT but one thing is missing.
> >
> > If the main thread dies due to some fatal error other threads will live
> > further. This problem is not easily solved without manager thread so
> > kernel will have to help here.
> >
> > This is an proposal for CLONE_KILLVMCH. The process/thread that
> > has this flag set will kill all its children that share the same VM
> > (were created with CLONE_VM) when it dies.
> > This way the main thread will clean threads when some fatal error
> > or kill occurs that cannot be caught in user space.
> > I think that this is the only obstacle to make pthread support without
> > manager thread and thus solve performance problems with creating and
> > managing threads.
> >
> > Any ideas are highly appreciated.
> >
> > Here goes the patch that implement CLONE_KILLVMCH. I think it is not
> > perfect but consider something like this as addition to the kernel.
>
> How about looking at prctl(2), which was added for just this purpose?
>
> Regards,
>
> Richard....
> Old: rgooch@atnf.csiro.au
> Current: rgooch@ras.ucalgary.ca
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:30 EST