for example,
boolean[] booleanArray = new boolean[10];
I just want to make sure each single read and write is volatile.
Should I do: (I am not sure if the volatile is applied to the array or each boolean)
volatile boolean[] booleanArray = new boolean[10];