[cpp-threads] Re: Thread API interface tweaks

Howard Hinnant hinnant at twcny.rr.com
Wed Aug 30 23:35:38 BST 2006


On Aug 30, 2006, at 6:19 PM, Lawrence Crowl wrote:

>> On Aug 29, 2006, at 5:00 PM, Lawrence Crowl wrote:
>> > Futures are a very valuable facility, too valuable to be tied to
>> > threads.
>> > They should be a separate facility that happens to also work with
>> > threads.
>>
>> That sounds very interesting to me.  Got a prototype?  I'll start
>> working, but I don't trust myself to correctly implement this
>> suggestion.  It would be good to have more than one prototype to look
>> at.
>
> I'll take a look.  The idea only came to me during Herb's talk.

It occurred to me after I wrote this that Peter's proposal may  
already fit this bill (I'm not sure).

>> On Aug 29, 2006, at 5:00 PM, Lawrence Crowl wrote:
>> > We already have a keyword __thread, and I think that defining a  
>> type
>> > named thread will lead to confusion.  The joiner terminology at  
>> least
>> > does not have that problem.
>>
>> Agreed.  Although I'm not as sure of the resolution.  We could rename
>> either __thread or thread.  E.g. __thread_local.
>
> Yes, though I note that __thread is already in compilers and programs.

We're going to have new keywords in C++0X, that appears to me to be a  
given (static_assert, auto, decltype, probably where).  How 'bout  
"thread_local" (and compilers can keep __thread for backwards  
compatibility too).

-Howard




More information about the cpp-threads mailing list