[cpp-threads] Asynchronous Function Proposal

Peter Dimov pdimov at mmltd.net
Mon Jun 8 22:47:07 BST 2009


Anthony Williams:
> Boehm, Hans wrote:
>> This seems to hinge on the thread-locals issue.  (Even if we say
>> "new" thread in the standard, the underlying threads implementation
>> can of course still cache.  The real difference seems to be whether
>> you get new thread_local variables or not.)
>
> You can detect thread reuse with std::this_thread::get_id() as well as 
> with thread-locals. But the thread-locals is the major issue.

Yes. You can also detect thread reuse with the native equivalent of 
thread::id, the native equivalent of thread_local, and with every thread 
local variable (which is not necessarily thread_local) such as a per-thread 
random seed, per-thread locale, and so on, both in the standard library and 
in third-party libraries. 




More information about the cpp-threads mailing list