The scope of my question is STRICTLY limited to the simultaneous read and write of an address in memory and what happens in hardware.
I am not interested in knowing about race conditions and what they might carry AFTER the program continues executing by using a value where this race occurred. If the logic of a pc is broken, yes, they might carry also a crash, but here my question is strictly about hardware and the effect of WRITE+READ from simultaneous threads.
QUESTION: Suppose I write a variable from one thread and I read from another thread the same variable. What will happen?
- just corrupt the value of the variable , so that all following thread will read a wrong value due to the interleave of this read/write?
or
- in certain case, can also cause the app to go down because this might be in some case some kind of violation in hardware.
Essentially I want to know more about the process of physically reading and writing at the same time of a variable and what the PC behaves.
I am using LINUX and C++ and I am interested in 2 cases
2 threads on the same physical core
2 threads on 2 separate cores