Re: thread group comments

From: Andi Kleen (ak@suse.de)
Date: Sat Sep 02 2000 - 05:54:43 EST


On Fri, Sep 01, 2000 at 06:33:42PM -0700, Ulrich Drepper wrote:
> "Andi Kleen" <ak@suse.de> writes:
>
> > But I guess you don't want the context switch to a thread manager just to
> > generate a thread ? (and which is one of the main causes of the bad thread
> > creation latency in Linux currently)
>
> The thread manager, is I see it in the moment, will consist more or
> less of this:
>
> extern volatile int nthreads;
> do
> waitpid (0, &res, __WCLONE)
> while (nthreads > 0);
> exit (WEXITSTATUS (res));
>
> No signal handler, since it cannot receive signals. Everything else
> the threads will do themselves.

With SA_NOCLDWAIT you wouldn't need that. IMHO wait does not make too much
sense for threads, because it is cheaper to just store the pthread exit data
somewhere in the address room (what I think the current implementation does
anyways)

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:13 EST