I have synchronized doGet() and doPost() methods in my servlets. Will this create any problem? Should i use the single thread model instead?

Alex Chaffee

This question is answered in the main Servlets/Threading question, http://www.jguru.com/jguru/faq/view.jsp?EID=150, especially point 4.

Don't use SingleThreadModel either, since there are many pitfalls.

Unfortunately, there's no shortcut to thread safety. Just learn the techniques, synchronize access to shared data only, and you'll be OK.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact