Nvidia, TLS and __thread keyword -- an observation
Terry Lambert
tlambert2 at mindspring.com
Wed Jun 18 01:50:13 PDT 2003
[ ... removed poor nVidia folks ... ]
Julian Elischer wrote:
> Libthr and libkse (i386) can be modified to both have the same
> support. The spec requires that %gs:0 is the address of a pointer to
> the thread control block (TCB). In kse this is easily achieved
> by puting such a pointer at the front of the KSE mailbox. (where %gs
> points), and in libthr the pointer points directly to the TCB itself
> (as far as I see) and there could be a pointer to itself set there.
I don't understand this statement.
Specifically, %gs points to a KSE that may have multiple threads
associated with it, and must therefore have multiple implicit TLS
instances associated with it. You can't do this without some sort
of indirection, above and beyond just %gs, unless you agree to have
a 1:1 relationship between threads and KSEs.
-- Terry
More information about the freebsd-threads
mailing list