[cpp-threads] Asynchronous Execution Issues (caching_async)

Peter Dimov pdimov at mmltd.net
Wed Apr 29 18:55:25 BST 2009


Nelson, Clark:
> As a result, *there simply is no existing practice* for a thread-local 
> object with a destructor. This is strictly an invention by the C++ 
> committee, which no one is or can be currently using. And based on this 
> discussion, I'm wondering if the committee didn't step rather farther out 
> on a limb than they should have.

In addition to what Anthony said...

There does exist a legitimate need to clean up resources held by 
thread-specific objects. The problems introduced by TSD destructors do not 
disappear when you disallow TSD destructors; rather, you create one more 
problem for the programmer on top of that, namely, how to implement TSD 
destructors (reliably and without killing performance). And this is a pretty 
hard problem in general. :-) 




More information about the cpp-threads mailing list