[cpp-threads] RE: volatile, memory models, threads

Herb Sutter hsutter at microsoft.com
Wed Mar 1 20:43:34 GMT 2006



Doug wrote:
> reading Bart Smaalders's ACM queue article
> http://www.acmqueue.com/modules.php?name=Content&pa=showpage&pid=366
> where on the last page, he recommends using plain concurrent reads
> on scalars rather than RWLocks or regular locks. In Java, this is fine
if
> such variables are declared "volatile". The way we are heading here,
in
> C/C++, it is likely to be OK only if an atomic type, which will entail
> additional work and understanding that fewer programmers will get
right.

As someone who hasn't closely followed all the details of the various
proposals and alternatives: Could you summarise the difference between
Java 5 volatile and the current proposal for C++ volatile (assuming we
do reuse that qualifier which seems like a good idea)?

Herb




More information about the cpp-threads mailing list