This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

init() method thread-safe

 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Some research at http://www.jguru.com/faq/view.jsp?EID=150 suggests that my first call is not thread-safe but the second one is.
I'm looking for confirmation of this, since I can't find anything to suggest this in the relevant specifications.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since it is the responsibility of the servlet container to call init, you are guaranteed that only one Thread will be calling it in a given servlet instance. However, it is your problem to understand the behavior of SomethingElse.getMyObject.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic