This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes init() method thread-safe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "init() method thread-safe" Watch "init() method thread-safe" New topic
Author

init() method thread-safe

Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608

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.


Tony Morris
Java Q&A (FAQ, Trivia)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: init() method thread-safe
 
Similar Threads
How to make dynamic radio button checked
Servlets - help
recommend a nice resource on......
<security-constraint> in web.xml
Servlet: Multithreading Issues