[cpp-threads] C++ committee meeting in Mont Tremblant

Andrei Alexandrescu andrei at metalanguage.com
Sat Oct 15 01:28:47 BST 2005


Doug Lea wrote:
> Peter A. Buhr wrote:
> 
>>  
>>    The term that is normally used -- "adding threads via a library" -- 
>> is    perhaps too loose. I think that "presenting threads via a 
>> library" is    another way of looking it.
>>
>> I guess I don't appreciate the subtle semantic difference. To me it's 
>> either a
>> library approach or it's a language approach, and never the twain 
>> shall meet.
>> It's like being pregnant: either you are or you are not, and you 
>> accept the
>> consequences of each case.
> 
> 
> Well, in Java we learned to cheat. JSR166 (concurrency), JSR51(nio),
> and others changed the language by defining operations that cannot
> be explained in terms of other language features (nothing exotic, just
> things like CAS and park/unpark (primitive thread-blocking)) which
> forces JVMs to specially recognize ordinary-looking method calls to
> implement as "intrinsics".

There is one precedent in C++ too, in a way antagonistic/complementary 
to the example above. The typeof operator is built in, however it 
returns something that has no meaning unless you have included 
<typeinfo>, and which otherwise has regular class semantics.

Andrei



More information about the cpp-threads mailing list