> Otherwise, I'd probably take a look at boost's TLS mechanism:
>
http://www.boost.org/doc/libs/1_39_0/doc/html/thread/thread_local_storage.html
I would go this route. I haven't looked at the BOOST implementation, but
there have been issues in the past with pthead_key_create. If performance
is an issue, post here and we can talk about ways to optimize that.
It would be nice if Thrift had a thread_create_hook and a
thread_delete_hook, since thread lifetime isn't discussed in
TThreadPoolServer. Is that worth opening an issue?
Hope this helps.
/r$
--
STSM, WebSphere Appliance Architect
https://www.ibm.com/developerworks/mydeveloperworks/blogs/soma/