pthreads in Linux
Wolfram Gloger
Wolfram.Gloger@dent.med.uni-muenchen.de
Wed May 9 06:09:00 GMT 2001
> 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.
More information about the Libc-alpha
mailing list