Thursday, June 16, 2005

jGuru: How do I ensure that my servlet is thread-safe?

jGuru: How do I ensure that my servlet is thread-safe?: "Re: How local data in servlet is syncronized
Steve Xu, Aug 9, 2003
don't confuse the instance variable with the local variable inside service method. instance variable: allocated at the object level, needs to be synchronized. local variable: allocated on the stack of the calling thread, does not need to be synchronized.
"

No comments: