If I have a three-element array and multiple threads attempting to access those values. Is there a race condition if I protect each of the three indexes with a separate lock?
In other words, if I know that no two threads will access the same index at the same time, but that multiple threads may access different indexes at the same time, is that enough to avoid the race condition?, or should I ensure that no two threads access the entire array at the same time, even if they access different indexes?