• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts:multiple threads modifying same method at same time in singleton ActionServlet

 
sabuj paul
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic