This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Re-use of user-defined stacks for threads
- To: Wolfram Gloger <wmglo at dent dot med dot uni-muenchen dot de>
- Subject: Re: Re-use of user-defined stacks for threads
- From: Ulrich Drepper <drepper at redhat dot com>
- Date: 28 Nov 2000 13:06:20 -0800
- Cc: libc-alpha at sources dot redhat dot com
- References: <20001125113341.29693.qmail@md.dent.med.uni-muenchen.de>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> writes:
> LinuxThreads breaks this, because the actual freeing of the thread
> resources within the stack can occur _after_ pthread_join() has
> returned. Below is a fix.
I agree with the analysis but the patch is not OK. It creates a race.
If the manager is restarting the joining thread before the latter
actually suspended itself we have a problem.
Probably the joining thread should deallocate the stack somehow.
Don't know yet what the solution should be.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------