
7 Apr
2006
7 Apr
'06
11:38 a.m.
On 4/7/06, Peter Dimov <pdimov@mmltd.net> wrote:
Felipe Magno de Almeida wrote:
It seems to me that thread_specific_ptr has a broken interface and documentation, since it doesnt address the local static thread-safety issue. Which leads users to use it erroneously.
Whether local statics are thread-safe is implementation dependent, and is not limited to thread_specific_ptr. _Any_ dynamically initialized local static can lead to the failure you described.
Surely, and that's why it is wrong to use it in portable code that way. And, IMO, the interface of thread_specific_ptr leads to believe that it is safe to use it that way. -- Felipe Magno de Almeida