Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2003 22:27:05 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Gareth Hughes <gareth@nvidia.com>
Cc:        Andy Ritger <ARitger@nvidia.com>
Subject:   Re: NVIDIA and TLS
Message-ID:  <3EEEA6A9.5F8D60C3@mindspring.com>
References:  <2D32959E172B8F4D9B02F68266BE421401A6D7CD@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, Andy Ritger wrote:
> > So from an OpenGL point of view, here are several alternatives that
> > I see for atleast the near term:
> >
> >     - make NVIDIA's OpenGL implementation not thread-safe (just
> >       use global data rather that thread-local data)
> >
> >     - accept the performance hit of using pthread_getspecific()
> >       on FreeBSD.  From talking to other OpenGL engineers,
> >       conservative estimates of the performance impact on
> >       applications like viewperf range from 10% - 15%.  I'd like
> >       to quantify that, but certainly there will be a performance
> >       penalty.
> 
> And these are *very* conservative estimates -- you're essentially adding a
> function call into a path that is, on average, less than ten instructions
> per OpenGL API call, where the number of API calls per frame is upward of 3
> million (3 calls per vertex, over a million vertices for some Viewperf
> benchmarks).  The API was designed this way for a reason, and fast
> thread-local storage is a fundamental part of a high performance
> implementation.

What do you do on systems where you can't grab the %gs register
and use it for whatever you want, because it's in use for something
else?

The pthread_getspecific() could probably be made into an inline, at
the very least, and could potentially be made to lazy-bind %gs to
the evil use to which it's currently being put.

-- Terry



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