memory mapped files and pointers to volatile objects
问题 My understanding of the semantics of volatile in C and C++ is that it turns memory access into (observable) side effects. Whenever reading or writing to a memory mapped file (or shared memory) I would expect the the pointer to be volatile qualified, to indicate that this is in fact I/O. (John Regehr wrote a very good article on the semantics of volatile ). Furthermore, I would expect using functions like memcpy() to access shared memory to be incorrect, since the signature suggests the