Is there any rules to access shared memory at the same time in multicores?
If one core is writing the shared memory, another core is reading the same memory at the exact same time, is there any problem with that?
SHALL This kind of scenario be avoided?
Is there any rules to access shared memory at the same time in multicores?
Share
This is called a race condition and the result of such code will be unpredictable. You HAVE to avoid it. You can either:
As @DanDan said, only reading from several threads is not a problem.