[cpp-threads] Asynchronous Execution Issues (caching_async)

Anthony Williams anthony at justsoftwaresolutions.co.uk
Wed Apr 29 16:48:45 BST 2009


At Wed 29 Apr 2009 16:37:45 BST, "Nelson, Clark"  
<clark.nelson at intel.com> wrote:

>> It seems to me that Cilk, TBB et al. are also likely to run into this
>> issue. The reason they haven't yet may just be that we
>> currently tend to
>> have poor support for destruction of __thread variables and
>> the like, and
>> that these systems so far have somewhat limited use??
>
> My impression is that it is really a gross understatement to say   
> that there is "poor" support for destruction of thread-local   
> variables. My understanding is that existing compilers flat-out   
> refuse to accept a thread-local declaration of an object with a   
> destructor.
>
> 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.

POSIX thread-specific values can have destructor functions which are  
called when the thread exits. Similarly, boost::thread_specific_ptr  
provides for C++ classes with destructors.

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





More information about the cpp-threads mailing list