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

Doug Lea dl at cs.oswego.edu
Wed Mar 1 21:03:41 GMT 2006


Herb Sutter wrote:
>  
> 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)?
> 

I don't think we've discussed this is a while, but last I recall,
C++ volatile would be slightly weaker than Java, in that it could
map to IA64 ld.acq/st.rel. Although on x86 and sparc would probably
be implemented the same as Java: Reorder constraints, plus a StoreLoad
on writes.

I'm sure others will remind me if I've misremembered this :-)

-Doug




More information about the cpp-threads mailing list