Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit


» HP STK home
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
Content starts here

critical impact:

TLS - feature differences (CrCh320)

TH Impacts

Problem description

The TLS features offered by the Tru64 UNIX and HP-UX operating system platforms are different.

Thread Local Storage (TLS) is data that is allocated to a specific thread for that thread's lifetime. TLS is not shared between threads and is treated as if each thread has its own copy of the data. TLS is not part of the POSIX IEEE 1003.1c standard; however, it is supported on both HP-UX 11i and Tru64 UNIX with the help of the platform compilers.

On Tru64 UNIX, TLS variables can be declared using the following, where __declspec(__thread) declares the xyz TLS variable:

__declspec(__thread) static int xyz; 

The Tru64 UNIX compiler also accepts __declspec(thread) as a variant of __declspec(__thread).

On HP-UX, TLS variables can be declared using the following, where __thread declares the xyz TLS variable:

__thread int xyz; 

The __declspec(__thread) functionality is being changed. As of the AR1204 compiler release, it will invoke the existing IPF ABI TLS model, which is described in the IA-64 TLS Supplement. For more information on the Tru64 UNIX TLS implementation, see Section 12.4.2 in the 5.1B version of the Tru64 UNIX Programmer's Guide.


C/C++ Functions__declspec      

See also

Solution description

Use the __thread keyword or wait until the AR1204 compiler release when the __declspec declaration is expected to become available on HP-UX.

The currently available compilers use the __thread keyword instead of the __declspec(__thread) keyword. Developers porting TLS applications before AR1204 is available will need to change their sources. As of AR1204, the compiler will accept all variants: __declspec(__thread), __declspec(thread), and __thread, and will invoke the IPF ABI TLS model described in the IA-64 TLS Supplement.

Problem summary

classifications source types OS release severity type
TH C, C++ any HP-UX 11i version critical changed
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.