4 ms·
Another thread can access it and do that, how could the compiler possibly know about it?
by LtWorf 8mo ago
Another thread can access it and do that, how could the compiler possibly know about it?
- bmm6o 8mo agoThere are documented ways to ensure that changes are visible across threads (e.g. locks). If these are not used, the compiler is within its rights to not go out of its way to pull changes from another thread.