Re: [patch] exit_free(), 2.5.31-A0

Ingo Molnar (mingo@elte.hu)
Tue, 13 Aug 2002 19:50:38 +0200 (CEST)


On Tue, 13 Aug 2002, Linus Torvalds wrote:

> It may be small, but it's crap, unless you can explain to me why glibc
> cannot just cannot just catch the death signal in the master thread and
> be done with it (and do all maintenance in the master).

we dont really want any signal overhead, and we also dont want any extra
context-switching to the 'master thread'. And there's no master thread
anymore either.

the pthreads API provides sensible ways to just get rid of a helper thread
without *any* handshaking or notification done after exit with any of the
other threads - the thread has finished its work and is gone forever.

the fundamental problem is getting rid of the stack atomically, it's a
catch-22. A thread can be interrupted by a signal on the last instruction
it executes, it can be ptrace debugged, etc. And something must notify
about completion once the stack is 100% unused.

(i'll add any other, userspace-only solution to the code if there's any
that has equivalent performance - i couldnt find any other solution so
far.)

Ingo

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