Subject: Re: [Threads-devel] BOOST_THREAD_LOCAL support
From: Fredrik Orderud (forderud_at_[hidden])
Date: 2013-02-21 16:35:44
On Thu, Feb 21, 2013 at 8:22 PM, Fredrik Orderud <forderud_at_[hidden]> wrote:
> On Thu, Feb 21, 2013 at 7:49 PM, Vicente J. Botet Escriba <
> vicente.botet_at_[hidden]> wrote:
>> Yes, I believe Windows XP will be supported yet. BTW, I use windows XP
>> to test the windows part.
> Then we might need to emulate thread-local storage somehow. This can be a
> bit tricky, since __thread/__declspec(thread) are not types, but
> storage-class modifiers. My first thought was to provide a small class with
> a syncronized map[thread_id] -> value container as fall-back emulation, but
> that will not be possible unless we "templatize" the
> BOOST_THREAD_LOCAL_RESTRICTED by type somehow. Any thoughts on this?
>> I will have some free time next week. Maybe you could post on the
>> development ML to request interest for the Boost.Config library.
> Sounds great!
I think I've now managed to extend the macro with thread_local emulation
for MSVC in WinXP-compatible mode (not default for MSVC 11). The emulation
can also be applied for any linux/apple/unix platform that we determine is
without __thread support by modifying the macro logic. Could you please
give me some feedback on the attached patch?
Thanks in advance,