Can C++ return different memory address for same variable with & operator?

Viewed 94

If two or more processor cores copy a variable into their local cache, how C++ handles that? Does &var return a different memory address depending on which core executed that instruction?

1 Answers

The address you get is the logical address in RAM not the address in cache. Its the cache controllers job to 'know' what RAM address are in what parts of its caches

Related