If your servlet implements SingleThreadModel the container will take the responsibility to do synchronization. So you can be sure only one thread will execute e.g. the service() method at a time. Otherwise when you access or mutate the servlet instance/static fields from inside the service() method, you must protect your fields from concurrent access with synchronized blocks.
Zoltan Szalay On Fri, 2003-07-25 at 16:54, Shivanjali Bhutkar wrote: > I would like to know about multithreading in servlets. > Is the SingleThreadModel used when mutlithreading or not? If no then what's > the purpose of it and what is generally done when servlet is used by many > concurrent users at same time. > thanks > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
