Close
jGuru Forums
Posted By: Anonymous Posted On: Monday, June 7, 2004 02:41 AM
I a method per se threadsafe if it doesn't make use of any global variables? I think about code like this.
String examplemethod(String a) { String lowerA = toLowerCase(a); ... [some time consuming tasks] String result = someOtherMethod(lowerA); ... return result }
If a second Thread enters the method and sets lowerA, does this affect the first Thread that might be just before calling someOtherMethod(lowerA)? Or is it a totally different instance of "lowerA"?
Re: methods that don't access member variables
Posted By: Anjani_Kalyan Posted On: Tuesday, June 8, 2004 09:20 PM