Hello!
I have red that access to different element of array is thread-safe, but to same is not.
But why this code work without any trouble?
var array = new int[1];
Parallel.For(0, 10000000, i => array[0] = i);Hello!
I have red that access to different element of array is thread-safe, but to same is not.
But why this code work without any trouble?
var array = new int[1];
Parallel.For(0, 10000000, i => array[0] = i);