This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet variable scope?

 
akshat nimbalkar
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i access all the servlet variables in all the service threads? does Synchronization play any role here?
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, instance variables would be available. In general this is a Bad Idea since Servlets are multithreaded and accessing instance variables would produce race conditions galore. Synchronizing instance variables to prevent race conditions, on the other hand, reduces the efficiency of multithreading.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic