Does “volatile” guarantee anything at all in portable C code for multi-core systems?
问题 After looking at a bunch of other questions and their answers, I get the impression that there is no widespread agreement on what the "volatile" keyword in C means exactly. Even the standard itself does not seem to be clear enough for everyone to agree on what it means. Among other problems: It seems to provide different guarantees depending on your hardware and depending on your compiler. It affects compiler optimizations but not hardware optimizations, so on an advanced processor that does