OpenGL and the LinuxThreads pthread_descr structure
Ulrich Drepper
drepper@redhat.com
Mon May 20 00:02:00 GMT 2002
On Thu, 2002-05-16 at 20:08, Gareth Hughes wrote:
>
> > Beside, I don't understand why you react like this. Using __thread is
> > the best you can ever get. It'll be portable (Solaris 9 already has the
> > support as well) and it's faster than anything you can get to access the
> > data.
>
> I disagree that __thread is the best you can ever get. In the best
> case, you have an extra load and subtraction before you have the address
> of a thread-local variable. In the worst case, you have a function call
> in there as well.
If you define your variable correctly using __thread can be as efficient
as anything else.
But this all is irrelevant: once I have a bit of time glibc will switch
to use the __thread mechanism for all the internal thread-local
variables. There will be no special block for variables in the thread
descriptor. Using __thread is a structured way to get such
functionality. It doesn't require synchronization with other ABIs and
that's the most important thing.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20020520/f6cfe0fd/attachment.sig>
More information about the Libc-alpha
mailing list