pthreads-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pthreads-hackers] threadvar and non-fixed size stacks


From: Jeroen Dekkers
Subject: Re: [Pthreads-hackers] threadvar and non-fixed size stacks
Date: Wed, 30 Jan 2002 21:11:53 +0100
User-agent: Mutt/1.3.25i

On Wed, Jan 30, 2002 at 06:21:06PM +0100, Johan Rydberg wrote:
> Hi!
> 
> Looking through the Hurd sysdeps I found that 'pthread_self' uses
> the Hurd threadvar mechanism.  But how does this work with stacks
> that is of non-fixed size (using 'pthread_attr_setstacksize')?
> 
> From what I have understood is that all stacks in a process must
> have the same size to make the Hurd threadvar thingy work.

We use a thread-specific register for that. On the ia32 architecture,
that means we use the segment register gs. When we are setting up the
stack, we load the register with the address of the TSD (Thread
Specific Data)(see sysdeps/mach/hurd/i386/init-first.c). Then
__hurd_threadvar_location() just uses %gs to calculate the
address (see hurd/hurd/threadvar.h). Note however that this
implementation is not totally finished yet and it's untested.

It's nice to hear people are reading the code. Don't hesitate to send
any comments/patches. :)

Jeroen Dekkers
-- 
Jabber supporter - http://www.jabber.org Jabber ID: address@hidden
Debian GNU supporter - http://www.debian.org http://www.gnu.org
IRC: address@hidden

Attachment: pgp93pLUbZ1kn.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]