Boost logo

Boost :

Subject: Re: [boost] [thread] static thread_specific_ptr?
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2009-02-26 05:11:27


Roland Schwarz <roland.schwarz_at_[hidden]> writes:

> Roland Schwarz wrote:
>> Does this mean you have solved the initialization problem for
>> local statics? i.e. you made this thread-safe for every compiler?
>
> Sorry, the shown usage pattern of course is not necessarily
> usgae as a local static.
>
> Nevertheless the question arises if the usage as a local
> static is thread safe. I.e. in the example shown struct X
> should live as a global variable in general. (I.e. if there
> are no provisions in thread_specific_ptr that make it safe.)

No, I haven't solved it. Local statics are still a problem.

The question was about a class static, which is global, and thus safe.

Anthony

-- 
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library   | http://www.stdthread.co.uk
Just Software Solutions Ltd         | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

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