I have a Thread sub-class called XmlProcessor that needs to accept some list or array of Strings to process. I need this list to be completely private to each thread, so that it isn’t modified in any way by other threads. What is my best option?
Thanks,
Jared
Based on Jareds comment it seems you have something that looks like this.
If my assumption is true then the reason listBonds.get() is null is because a different thread is accessing listBonds when you invoke
setto when you invokegetImage this
If this is the case then the Runnable instance will be inherently thread-local/thread-safe and then you can have the List be an instance variable of the Runnable