Slides for tomorrow night

Andrei Alexandrescu andrei at metalanguage.com
Mon Oct 18 17:24:33 BST 2004


> Slide 15: "const objects are inherently thread-safe without any 
> synchronization" is a false statement. To be more precise, it is not 
> always true: you need to distinguish between physical immutability and 
> conceptual or logical const-ness. Where the const means the former the 
> statement is clearly true, but not all const objects qualify (sic).

Ah, yes. I need to rephrase that. Maybe 'const primitive fields are 
guaranteed to be valid upon construction termination'?

Doug - indeed const is linked to final in the following way: if we 
ignore 'mutable' (which in C++ allows you to still keep changeable state 
in a const object), then a const C++ object is pretty much like a Java 
object with only final fields.


Andrei






More information about the cpp-threads mailing list