We use __thread pretty extensively in Kudu and it works fine. That said, we
make sure that all of our __thread variables are PODs or pointers, and in
the case that we want to actually run a destructor on thread-exit, we use
our own wrappers in kudu/util/thread_local.h which take care of
Pretty sure that boost::thread uses pthreads under the covers, so I think
the question is whether thread_local works with the lowest common
denoninator pthreads.
It sounds like thread_local uses an older mechanism __thread under the
covers that
A quick git grep shows use of both boost::thread and pthread. C++14 has a
thread_local keyword:
http://eel.is/c++draft/basic.stc.thread
Do we know if the semantics of thread_local in C++14 are compatible with
thread-locality in pthreads and boost::thread?