Struts:multiple threads modifying same method at same time in singleton ActionServlet
sabuj paul
Greenhorn
Joined: Oct 29, 2003
Posts: 10
posted
0
In struts framework , there is one ActionServlet which is singleton in nature and work on different user threads.Now suppose one thread change any method on action servlet and at the same time another thread accesing the same page trying to change the same method or same variable.So if number of threads trying to change the same method or variable at the same, wont there arise any problem bcos of this? Or pls tell how struts handle this situation.
As long as the variables are local to the method you're safe. Each thread gets its own copy of those variables. It's mostly the instance variables you need to be wary of. Dave
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Struts:multiple threads modifying same method at same time in singleton ActionServlet