InomHitta mer dokumentationSupportresurser som ingår | Ladda ner denna bok i PDF (1976 KB)
A.2.176 -xthreadvar[=o]Specify -xthreadvar to control the implementation of thread local variables. Use this option in conjunction with the __thread declaration specifier to take advantage of the compiler’s thread-local storage facility. After you declare the thread variables with the __thread specifier, specify -xthreadvar to enable the use of thread-local storage with position dependent code (non-PIC code) in dynamic (shared) libraries. For more information on how to use __thread, see 4.2 Thread-Local Storage. A.2.176.1 Valueso must be one of the following: Table A–51 The -xthreadvar Values
DefaultsIf you do not specify -xthreadvar, the default used by the compiler depends upon whether or not position-independent code is enabled. If position-independent code is enabled, the option is set to -xthreadvar=dynamic. If position-independent code is disabled, the option is set to -xthreadvar=no%dynamic. If you specify -xthreadvar but do not specify any arguments, the option is set to -xthreadvar=dynamic. InteractionsUsing thread variables on different versions of Solaris software requires different options on the command line.
WarningsIf there is non-position-independent code within a dynamic library, you must specify -xthreadvar. The linker cannot support the thread-variable equivalent of non-PIC code in dynamic libraries. Non-PIC thread variables are significantly faster, and hence should be the default for executables. See Also-xcode, -KPIC, -Kpic |
||||