Implementing TLS: step 1

Daniel Eischen eischen at vigrid.com
Thu Jun 19 16:30:25 PDT 2003


On Thu, 19 Jun 2003, Julian Elischer wrote:
> 
> On Thu, 19 Jun 2003, Daniel Eischen wrote:
> 
> > 
> > > On ia64 we don;t need to use descriptors so there is not that limit so 
> > > in effect we could point directly to the thread descriptor and let THAT
> > > point to teh VCPU mailbox in question. it's just an extra write or two
> > > at context switch time. I think we'll be just fine.
> > 
> > It is not just that.  It is the cost of an ldt allocation for
> > each thread.  In libkse, we only need as many LDTs as there
> > are KSEs.  Allocating an ldt per-thread increases thread
> > startup and teardown.
> 
> that's sort-of-what I was saying..
> I think we are ok anyhow.. the spec for i386 is general enough so that
> we can use it as it is without problem.

Well, I guess you can do it two different ways for different
platforms, but that increases the amount of MD code in libkse.
It's nice now, because most of the KSE mailbox accesses are MI
(well, some relying on <machine/atomic.h>).

-- 
Dan Eischen



More information about the freebsd-threads mailing list