memory-model

How to understand happens-before consistent

廉价感情. 提交于 2019-11-26 03:59:22
问题 In chapter 17 of JLS, it introduce a concept: happens-before consistent. A set of actions A is happens-before consistent if for all reads r in A, where W(r) is the write action seen by r, it is not the case that either hb(r, W(r)) or that there exists a write w in A such that w.v = r.v and hb(W(r), w) and hb(w, r)\" In my understanding, it equals to following words: ..., it is the case that neither ... nor ... So my first two questions are: is my understanding right? what does \"w.v = r.v\"

C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?

给你一囗甜甜゛ 提交于 2019-11-26 00:39:03
问题 C++11 introduced a standardized memory model, but what exactly does that mean? And how is it going to affect C++ programming? This article (by Gavin Clarke who quotes Herb Sutter ) says that, The memory model means that C++ code now has a standardized library to call regardless of who made the compiler and on what platform it\'s running. There\'s a standard way to control how different threads talk to the processor\'s memory. \"When you are talking about splitting [code] across different