Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2002 13:24:41 -0500 (EST)
From:      Daniel Eischen <eischen@pcnet1.pcnet.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        Terry Lambert <tlambert2@mindspring.com>, arch@FreeBSD.ORG
Subject:   Re: FWIW... maybe this way already?
Message-ID:  <Pine.GSO.4.10.10202011319570.16436-100000@pcnet1.pcnet.com>
In-Reply-To: <Pine.BSF.4.21.0202010959220.67160-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 1 Feb 2002, Julian Elischer wrote:

> this is what mach threads did..
> nowm the question is: how do you know where the beginning of the stack is?

This has been discussed in the past.  No, we don't know where the
stack is or where it starts.  Supporting POSIX threads prevents
the implementation from always using a standard stack size (see
pthread_attr_setstackaddr, pthread_attr_setstacksize).

> On Fri, 1 Feb 2002, Terry Lambert wrote:
> 
> > Linux did what I think is an incredibly clever thing.
> > 
> > They put the current CPU at the beginning of the stack,
> > and then change it when/if they migrate the process.
> > 
> > Since KSEs have stacks, as well, you could put the
> > process and thread ID after the CPU ID, there.
> > 
> > Saves weirding out a register to get the CPU, PID, TID,
> > since the stack base is always known.
> > 
> > FWIW.
> > 
> > -- Terry

-- 
Dan Eischen


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10202011319570.16436-100000>