[cpp-threads] memory model

Doug Lea dl at cs.oswego.edu
Thu Apr 28 12:19:13 BST 2005


Alexander Terekhov wrote:
> 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.

I don't see any unsolvable probelms here.

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

Please propose an alternative that is at least as usable for
common usages for an average programmer. We don't know of any.


-Doug




More information about the cpp-threads mailing list