Boost logo

Boost :

Subject: Re: [boost] [thread] thread_specific_ptr performance
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2010-01-09 07:22:23


On 01/09/2010 03:19 AM, Stefan Strasser wrote:

>> 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?

I don't have a discussion thread at hand, but these pages of MSDN may be
of interest for you:

http://tinyurl.com/ycmwwmd
http://tinyurl.com/y8nfoal

In short:

* The TLS must have static duration.
* Only POD types are supported as TLS declared with __declspec(thread).
* It doesn't work if TLS is defined in a delay-loaded dll.

Not sure what constraints are for __thread in GCC but it looks like it
too supports only POD types with static duration.

http://tinyurl.com/yae8h8c

Also, AFAIU, these mechanisms are based on OS-provided APIs, which may
have rather constrained TLS capacity. With Boost.Thread solution there's
virtually no limit for the number of thread-specific variables you may have.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk