Implementing TLS: step 1

Marcel Moolenaar marcel at xcllnt.net
Thu Jun 19 15:00:45 PDT 2003


On Thu, Jun 19, 2003 at 02:50:45PM -0700, Julian Elischer wrote:
> 
> Libthr has the advantage that the register used for identifying the
> current thread can be set DIRECTLY at the thread control block, where
> libkse will (probably) require a single indirection. (by which I mean
> that the register will point to the control structure for the Virtual
> CPU that is running (KSE) and that in turn will have a pointer to the
> thread that is currently running.

On ia64, the runtime specification dictates that the TP registers
points to the TLS. How the threads implementation relates this to
the thread control structure (or other control structures) is up to
the implementation. If libkse is ported to ia64, this will have to
be the case as well. Hence the thread pointer will *not* point to
the KSE.  An indirection will be used to point from the TLS to the
KSE.

There is no other way.

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel at xcllnt.net


More information about the freebsd-threads mailing list