Hi guys,
I am facing a ttypical issue with usage of threads in my application. I have a singleton object with a method like public List getXXX(List list1). This method is being hit by several threads. The problem is have is that before the method does something useful , some other
thread comes along and changes the reference of list1 to a different list. I thought of making this method synchronized, but doing so will make my application of no use. Basically this application splits a big method call in to smaller calls but spawning n number of threads and splitting the list1 parameter accordingly. If I sychronize the method, the final outcome will be much slower than calling the method without any threads.
Any help in this regard will be greatly appreciated.