Singleton updates in a Multithreaded environment
<p>In a multithreaded environment I have a Singleton with a static ArrayList. </p>

<p>Let's say one thread gets the instance and is doing a "for" loop to the ArrayList. Just reading. No updates. This might take sometime to complete. While this happens, another thread updates the ArrayList.</p>

<p>What will happen to the loop (first thread)? Ideally I would like the "for" loop to complete with "old" data and if I get the instance again, then to get the new set of data.</p>

<p>Is the trick in this case to not use volatile ? Or create a new ArrayList from the static ArrayList for the "for" loop? Or... ?</p>
