You are writing on this page that :
"declaring an array volatile does not give volatile access to its fields"
and also
it is unsafe to call arr[x] = y on an array (even if declared volatile) in one thread and then expect arr[x] to return y from another thread
if I have such an class :
public class Test {
int[] numbers = new int[Integer.MAX_VALUE];
void increment(int ind){
numbers[ind]++;
}
int get(int ind){
return numbers[ind];
}
}
and some reader threads , "get" and only one writer "increment".
I though not require further synchronization in this class in a case of MRSW.
But you claim that the elements inside the array could be cached. Is this right ?
Thanks