Boost logo

Boost :

Subject: Re: [boost] [thread] thread_specific_ptr performance
From: James Mansion (james_at_[hidden])
Date: 2010-01-12 15:42:06


Peter Dimov wrote:
> I don't think that any implementation gives you this constant time
> guarantee if you continually create thread-specific variables.
Why does any application, ever, need to even be allowed to 'contonually
create thread-specific variables' without being considered badly broken?

Thread-specific variables are a proxy for partitioned global data - and
that doesn't get created and destroyed except with DLL loading and
unloading. And DLL unloading somewhat extremely dodgy in C++ as it is.

If you have object instances (say, some sort of rule interpreter) which
wants to have thread-specific state then really its better handled with
a thread-specific map between the object instance address and its state
instance.

James


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