I was thinking about threads one day when I started to wonder if multiple threads can access the same information (not using synchronized(lock)) assuming they do not modify it at all.
An example would be 10 threads reading 1 class that is changing all the time due to a thread we'll call M. These threads call accessors to get information from this class but do not modify the information in any way.
Meanwhile, thread M is modifying the data inside this class occasionally (which would change the result of the calculations the 10 threads are doing once they 'restart')
Would there ever be an issue? Issue being one of those threads putting 'back' information that thread M has modified. On top of that, would there ever a be a time where accessing a piece of information would still result in Java putting the information back in memory even though it was never modified?
Thanks.
Edit: Would it be safe to call the accessor with a final before it? Like.. final Object t = someAccessor();