
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.