Note that there are some explanatory texts on larger screens.

plurals
  1. POC++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?
    text
    copied!<p>C++11 introduced a standardized memory model, but what exactly does that mean? And how is it going to affect C++ programming?</p> <p><a href="http://www.theregister.co.uk/2011/06/11/herb_sutter_next_c_plus_plus/page2.html" rel="noreferrer">This article</a> (by <strong>Gavin Clarke</strong> who quotes <strong>Herb Sutter</strong>) says that,</p> <blockquote> <p>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.</p> <p>"When you are talking about splitting [code] across different cores that's in the standard, we are talking about the memory model. We are going to optimize it without breaking the following assumptions people are going to make in the code," <strong>Sutter</strong> said.</p> </blockquote> <p>Well, I can <em>memorize</em> this and similar paragraphs available online (as I've had my own memory model since birth :P) and can even post as an answer to questions asked by others, but to be honest, I don't exactly understand this.</p> <p>So, what I basically want to know is, C++ programmers used to develop multi-threaded applications even before, so how does it matter if it's POSIX threads, or Windows threads, or C++11 threads? What are the benefits? I want to understand the low-level details.</p> <p>I also get this feeling that the C++11 memory model is somehow related to C++11 multi-threading support, as I often see these two together. If it is, how exactly? Why should they be related?</p> <p>As I don't know how the internals of multi-threading works, and what memory model means in general, please help me understand these concepts. :-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload