内存模型的基础知识
内存位置是什么?
struct S {
char a; // memory location #1
int b : 5; // memory location #2
int c : 11, // memory location #2 (continued)
: 0,
d : 8; // memory location #3
int e; // memory location #4
double f; // memory location #5
std::string g; // several memory locations
};两个线程访问相同的内存位置,会发生什么呢?
Last updated