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

ThreadSafety of Request and Response Objects

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Are Request and Response Objects thread when they are used out of the service() method..

What does this mean..and what are the situations the programmer has to be precautious when developing..

and is true that the Request and Response Objects shouldn't be referenced by objects executed by other threads?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Theepan Thevathasan:

Are Request and Response Objects thread when they are used out of the service() method.


Yes. These objects are created and references within a single thread. Ergo, no thread-safety issues.

What does this mean..and what are the situations the programmer has to be precautious when developing..


It means you don't need to worry about any synchronization issues with these instances.

and is true that the Request and Response Objects shouldn't be referenced by objects executed by other threads?


Absolutely. Doing so would introduce all manner of threading issues.
[ February 01, 2007: Message edited by: Bear Bibeault ]
 
Vivek Roy
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And that is exactly on what servlet model is based on.

Thanks
Vivek
http://www.rangsamarpan.com/
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic