This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
__thread or pthread_getspecific ?
- From: "Metuki Sabhe" <sabhe dot metuki at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Sun, 20 Apr 2008 18:00:24 +0300
- Subject: __thread or pthread_getspecific ?
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