Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2003 22:55:28 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Gareth Hughes <gareth@nvidia.com>
Cc:        Daniel Eischen <eischen@pcnet.com>
Subject:   Re: NVIDIA and TLS
Message-ID:  <3EEEAD50.C374C068@mindspring.com>
References:  <2D32959E172B8F4D9B02F68266BE421401A6D7DF@mail-sc-3.nvidia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Gareth Hughes wrote:
> On Mon, 16 Jun 2003, Julian Elischer wrote:
> >
> > can wine use OpenGL?
> >
> > Doesn't look like a clash to me.  :-)
> 
> I don't understand your point here...

His point is that you can feel free to use %fs, even though
WINE uses %fs, so long as you do not use WINE and OpenGL in
the same program.

In other words, the argument that you can't use %fs because
WINE does only holds water if you use OpenGL to implement
WINE, or WINE to implement OpenGL.  Otherwise, there's no
conflict.

> Currently, given the performance requirements of OpenGL, our drivers
> are one of the first users of the new ELF TLS implementation on Linux,
> outside of libc itself.  Given the fact that this is a general solution
> to a common problem, I strongly urge you to take it into consideration
> when working on your threading libraries.

This is problematic.  It constrains the implementation to a
specific architecture.  The 1:1 mapping of threads in Linux
and Solaris are basically a result of "N:M threads are hard
to get right; let's just implement 1:1, and go shopping!".

Likewise, until we know that this standard is not one of the
areas SCO is claiming Linux stole from SCO, it's going to be
risky to just follow Linux's lead (on anything!) for a while.


> There are only going to be
> more users of __thread variables as time goes on -- you can imagine
> that many multithreaded user-space server applications will start using
> this soon, instead of the clunky pthread TLS interface.

It's "clunky" for a reason: to discourage people from writing
"apartment" or "rental" model threaded application, instead of
"free threaded" applications, which are safely reentrant.

We can make it less expensive to use (I'm positive!), but to
make it less "clunky" would just encourage evil developers to
use it.  To paraphrase a wise man: people a lot smarter than
you or I designed the POSIX thread local storage API the way
it is for a reason... ;^).

-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EEEAD50.C374C068>