SPARC Assembly Language Reference Manual

Exit Print View

Updated: July 2014
 
 

5.4 Thread Local Storage (TLS) Code Models

The local executable code model uses the fastest code sequence, but it can only be used for code within an executable accessing a variable within that executable.

The initial executable code model allows code in the executable to access TLS variables in the shared objects to which the executable has been statically linked. The IE code is somewhat slower than the LE code.

The local dynamic code model allows code in a shared object to access TLS variables of its own. The LD code is usually somewhat slower than the IE code.

The general dynamic code model allows code from anywhere to access TLS variables anywhere. So, the executable could access a TLS variable in a dynamically linked shared object, for example. The GD code is the slowest.

Note that on Solaris, the %g7 register is used by the OS to point to thread data, and the TLS variables are sometimes accessed through this register. The program should not modify %g7 or unpredicatable results will happen.