This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: pthreads in Linux
- To: kapish at ureach dot com
- Subject: Re: pthreads in Linux
- From: Wolfram Gloger <Wolfram dot Gloger at dent dot med dot uni-muenchen dot de>
- Date: Wed, 9 May 2001 15:08:46 +0200 (MDT)
- CC: libc-alpha at sourceware dot cygnus dot com
- References: <200105091227.IAA25570@www21.ureach.com>
> In the code, I
> saw that for non-standard stacks, in thread_self,
> it just parses through the whole list of pthread
> stacks to match one with the current sp.
Yes, I believe this is the case, but only if the thread descriptor
can't be retrieved by other means. If glibc is compiled for i686 on
recent Linux kernels for example, a specific register is used to hold
the thread descriptor, and the list of stacks is _not_ traversed.
> 'coz we
> are concerned this might causes performance
> problems for us,
Really? Why do you need user-defined stacks, and so many of them?
IMHO there is very rarely a justification for user-defined stacks, and
the POSIX semantics are not very friendly.. In particular, you cannot
safely re-use the memory areas for thread stacks, because `thread
termination' isn't well defined.
Regards,
Wolfram.