NVIDIA and TLS
Daniel Eischen
eischen at pcnet.com
Mon Jun 16 15:28:39 PDT 2003
On Mon, 16 Jun 2003, Gareth Hughes wrote:
> On Mon, 16 Jun 2003, Julian Elischer wrote:
> >
> > It wouldn't take much for us to give you a "application specific
> > pointer" in the memory block that is pointed to by %gs.
> >
> > This would allow you to find your data with a single dereference
> > for the N:N threads library..
> >
> > %gs ----->[threadsystem-thread-specific-data]
> > [ stuff ]
> > [ ap-specific pointe ]---->[ your data ]
> > [ ]
> >
> > BUT
> > that would only work for the 1:1 threading library
>
> What's wrong with:
>
> %gs ----->[threadsystem-thread-specific-data ]
> [ stuff ]
> [libGL stuff (fixed size, known offset)]
%gs is for the KSE in libkse. Multiple threads can run
in the same KSE.
> Or, better yet, to make sure no problems arise when you change the internals
> of your data structures:
>
> %gs ----->[libGL stuff (16 words, say) ]
> [threadsystem-thread-specific-data]
> [ stuff ]
>
> You reserve the first 16 words of your thread data structure for us, and
> we're done. At least when this library is being used.
Again, %gs isn't per-thread; it's per-KSE. Plus, we're reserving
TLS for one vendor/library. What happens when someone else comes
along and wants the same thing? I'd much rather see someone push
for a new OpenGL spec with better interfaces/APIs.
--
Dan Eischen
More information about the freebsd-threads
mailing list