Two threads. The first furiously reading elements from the array. The second is equally furious in updating elements by reading them and incrementing them by an arbitrary amount.
Is this safe? can anything go wrong in this situation? I don't mind that the reading thread reads an 'old' value while the updating thread is still in the process of updating. I just want to make sure the reader doesn't ever read a number that was not written and also that an exception cannot occur.