• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread Safe

 
Gowher Naik
Ranch Hand
Posts: 643
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following are thread Safe
request attributes
response Object
local variables

Following are not thread Safe
servletcontext attributes
session attributes
instance variables

What about ServletConfig parameters?
Are they access by multiple threads at a single time?
i know ServletConfig parameters are Read Only constants.

Thanks
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletConfig Parameters are readonly then i think it doesn't matter
 
Elan Ram
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, we can set only the attributes. Not parameters. There are no setter methods to set the same.
Hence, Thread safety is applied only to attributes and not a paramters.
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More to note ...

As said, Parameters are thread-safe as there are no setters for the same.

Only in SingleThreadModel, instance variables are thread-safe.

Static Variables, Context Attributes and Session Attributes are never thread safe.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic