• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ThreadSafety of Request and Response Objects

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And that is exactly on what servlet model is based on.

Thanks
Vivek
http://www.rangsamarpan.com/
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic