
12 Jan
2010
12 Jan
'10
8:42 p.m.
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