In example with multithreading, it seems that JVM starts few threads in the beginning (const number of them).
Then, although there is supposed to be a data race, none happens actually, because all accesses are performed from a single thread.
Running the example (inputs/inc) confirms that there is no data corruption.
In example with multithreading, it seems that JVM starts few threads in the beginning (const number of them). Then, although there is supposed to be a data race, none happens actually, because all accesses are performed from a single thread. Running the example (inputs/inc) confirms that there is no data corruption.