Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can i say my servlet is Thread-Safe?.  RSS feed

 
rex tony
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i say my servlet is Thread-Safe?.
 
Ankur Bohra
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can implement SingleThreadModal in your Servlet.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... which you should NOT do. It's deprecated, and -even more importantly- does not guarantee that the servlet is thread-safe.

Much better to write the code in a thread-safe manner. That means protecting all mutable shared data -e.g. instance fields- against concurrent access (if one of the accesses might change the data).
[ January 08, 2008: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!