
----- Original Message ----- From: "Stefan Strasser" <strasser@uni-bremen.de> To: <boost@lists.boost.org> Sent: Saturday, January 09, 2010 1:19 AM Subject: Re: [boost] [thread] thread_specific_ptr performance (was: Re:Boostlibrary submission (poll for interest))
Am Friday 08 January 2010 20:36:46 schrieb vicente.botet:
is there any chance for a thread_specific_ptr implementation based on GCC __thread and MSVC __declspec(thread)?
__thread results in a simple read access using a thread-specific memory segment.
Hi, As Anthony has already state on other threads this seems to be not posible (the semantic is different).
could you point me towards that thread? the one about dynamically loaded libraries?
http://old.nabble.com/-thread--TSS-cleanup-tt19590361.html#a19617150
What about defining a macro BOOST_LOCAL_THREAD that do the needed portable issues? Have you make some measures with __thread and/or MSVC __declspec(thread)?
I'm not sure if you can bring together all the different semantics of those extensions using a macro. the proposal of C++0x thread local storage is about 10 pages: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm
Well the proposal may have 10 pages but the syntactical addition is quite simple, the problem is that each compiler has each own syntax.
BTW, Anthony has made some improvements to which thread_specific_ptr in 1.41. Which version are you using?
1.41
Have you made some mesurements comparing thread_specific_ptr and __thread for example? If there is a big difference maybe you could make a ticket then. Best, Vicente