[Dri-devel] Re: OpenGL and the LinuxThreads pthread_descr structure

Keith Whitwell keith@tungstengraphics.com
Wed May 22 02:59:00 GMT 2002


> 
> __thread doesn't require -fpic. There are 4 different TLS models (on IA-32):
> -ftls-model=global-dynamic
> -ftls-model=local-dynamic
> -ftls-model=initial-exec
> -ftls-model=local-exec
> 
> Neither of these require -fpic, though the first 3 use pic
> register (if not -fpic, they just load it into some arbitrary register).
> The GD model is for dlopenable libraries referencing __thread variables
> that can be anywhere (and is most expensive, a function call), LD is for
> dlopenable libraries referencing __thread variables within that library
> (again, a function call, but can be one per whole function for all __thread
> vars mentioned in it), IE is for libraries/programs which cannot be dlopened
> and can reference __thread variables anywhere in the startup program
> or its dependencies and LE is for programs only, referencing
> __thread variables in it. IE involves a memory load from GOT and subtracts
> that value from %gs:0, LE results in immediate being added to %gs:0.


It doesn't sound like there's anything in there for us that's a real 
improvement:  Both of the 'dlopenable' varients require a function call? 
That's a huge overhead for the application we're talking about.

Keith



More information about the Libc-alpha mailing list