Thread Safety
1 posts in topic
Flat View  Flat View

Posted By:   Jonathan_Bergquist
Posted On:   Wednesday, August 7, 2002 07:13 PM

I'm using a servlet as a controller to instantiate other java classes. If those classes are declared as instance level variables in the servlet, will variables that are local scope in my classes be thread safe?


Re: Thread Safety

Posted By:   Gautam_Marwaha  
Posted On:   Wednesday, August 7, 2002 08:52 PM

Variables in local scope are thread-safe as they are created on the stack. It is advisable to use local variables in servlets unless you are implementing SingleThreadModel
About | Sitemap | Contact