__thread or pthread_getspecific ?

Metuki Sabhe sabhe.metuki@gmail.com
Sun Apr 20 17:38:00 GMT 2008


Hello !

I need to use a thread local storage variable in a glibc/gcc linux application.

I wonder whether should I use glibc's pthread getspecific/setspecific routines
or just use gcc's __thread storage class keyword ?

Can you please tell me what are the pros and cons of either of these methods ?

Thank you in advance,
Sabhe



More information about the Libc-alpha mailing list