NVIDIA and TLS

Gareth Hughes gareth at nvidia.com
Mon Jun 16 15:56:25 PDT 2003


On Mon, 16 Jun 2003, Daniel Eischen wrote:
> 
> 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.

I don't think there's a library out there that has the strict
performance requirements that OpenGL does.  Of course, if FreeBSD
supported the ELF TLS standard, this point would be moot because
applications and libraries would automatically get fast
thread-local storage.  If not, and another library really did need
the same kind of fast TLS access, what's wrong with just allocating
another static block after the libGL one?  Your internal data
structures would work fine, libGL would work fine because you
haven't changed the location of its data block, and the new library
would access its data directly.  The only problem with this scheme
is if you move the block, or change the way it is accessed, this
would break binary compatibility.

-- 
Gareth Hughes (gareth at nvidia.com)
OpenGL Developer, NVIDIA Corporation


More information about the freebsd-threads mailing list