3 ms·
That is again, language-dependent. Java for example can memory-safely have data races, even those that tear (what you are referring to here). Not the standard,
by kaba0 3y ago
That is again, language-dependent. Java for example can memory-safely have data races, even those that tear (what you are referring to here). Not the standard, but OpenJDK itself also has a guarantee that every value that any thread could observe was actually set by some other thread, so on incrementing a number from 0 from multiple threads you can never get -37, but for surely can observe an older value.