Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> It will always remain orders of magnitude heavier than __thread
>> variables which are a) inlined and b) should only need two memory
>> accesses at worst. Moreover, it is clearly the future, while the
>> importance of pthread_getspecific will decrease over the time. The
>> __thread storage class is C99 standard (though its implementation
>> remains a separate topic).
> You are exagerating a bit: pthread_getspecific is pretty efficient
> already (from the few things that I have timed on ARM, it is the only
> one which takes under the microsecond). That you will gain something
> with __thread is not guaranteed by the C99 standard either: in fact the
> implementation could use exactly the same functions.

As long as we do not loose anything (performance or portability), there
is no point in sticking with pthread_getspecific. At least on x86 the
advantage is easily visible (==no more function calls). That's also due
to the lighter concept of __thread: it pushes the key resolution from
runtime to compile/link-time.


Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

Xenomai-core mailing list

Reply via email to