[cpp-threads] memory model

Alexander Terekhov alexander.terekhov at gmail.com
Thu Apr 28 10:13:58 BST 2005


Please stay away from volatiles. Please. In C/C++/POSIX they have 
defined semantics that has really nothing to do with threads. Consider
also that some implementation use volatile to control granularity

http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/V51_HTML/ARH9RBTE/DOCU0007.HTM#gran_sec
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/ARH9RBTE/DOCU0008.HTM

and requiring them to add barriers would not fly I'm afraid.

C/C++ volatiles are already quite messy and extending that mess 
with (heavy) msync is NOT good, I believe.

regards,
alexander.




More information about the cpp-threads mailing list