Can two threads read same CONST block of memory at the same time
-
01-07-2021 - |
Question
Block of memory is initialized and set at the start of program and didn't change(CONST). For example:
static const int a = 10;
If it's dependent on the environment/architecture, then are these settings safe:
- Intel/AMD
- Win/Linux 32/64bits
- Thread per core or all threads at onecore.
Solution
It is safe to read const for all architectures
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow