Details
-
Improvement
-
Resolution: Won't Fix
-
Minor
-
3.0.1
-
Security Level: Public
-
None
Description
https://github.com/couchbase/ep-engine/blob/3.0.1/src/threadlocal.h
has only two options, win32 and posix.
while on linux on gcc we have __thread keyword, which is known to be implemented much more efficient than posix approach.
under x86 32/64 access to tls variable is gs: selector indexed and offset in that selector is set by runtime-linker.
so no pthread_getspecific is required at all.
no call, no hash tables jumps, no nothing.
please consider to use it.