What are the similarities between the Java memory model and the C++11 memory model?
The Java memory model was an important influence on the C++11 memory model, and was where we pulled the terms happens-before and synchronizes-with from. However, the C++11 memory model offers much more fine-grained control over memory ordering than the Java memory model. Java volatile variables are equivalent to C++11 std::atomic<> variables, if you use std::memory_order_acquire … Read more