Subject: Re: proposal for Linux exit_group emulation
To: Chuck Silvers <chuq@chuq.com>
From: Frank van der Linden <fvdl@netbsd.org>
List: tech-kern
Date: 12/04/2005 10:57:12
Chuck Silvers wrote:
>I meant, does the linux thread library make assumptions which cannot be
>met in a single process? eg. does it require that each thread have a
>separate PID? if so, then we have to stick with the current model.
>but if the single-process model can work, then that would seem
>a better way to go.
>
>
The library does assume a unique (system-wide) thread-id exists, which
is of course simply the PID. Also, the way that this is implemented in
the Linux kernel does match the process (1:1) model.
To match our model and scheduling, using LWPs would be better, but for
simplicity, and perhaps even more correct emulation, using processes is
the easiest way to go.
Btw, the Linux kernel uses SIGKILL to implement exit_group, so I think
using this approach for the emulation is the right way to go; we'll
match the behavior closely. We just need to avoid any wait()
side-effects. It looks like the Linux kernel sets a flag that indicates
that this is a group exit, avoiding some of the normal exit
status/signal code in that case.
The solution won't be pretty in either case, but I think Emmanuel's
original idea was right.
- Frank