Hi
Can anyone suggest which one is better in terms of performance ---
maintaining a pool of servlets using Single ThreadModel or just keep the
servlet as it is ie only one instance. I understand that the answer depends
on whether to make ur servlet thread safe or not. I am just not getting when
u actually need to make the servlet thread safe --- as such the servlet will
never have any private data --- what it will do in doGet or doPost is to
mutate the session info --- which is global --- in this scenario do we need
synchronized access to the session object??? I dont think we need as the
servlet is mutating the session particular to that request. The code will be
something like this

 doGet(.......)
 {
       HttpSession h = req.getSession(false); // Session has been already
created in the login servlet say.
       h.put(....);
       ....
 }

Question is do we need to synchronize this particular block of code??? If
not the when do we need SingleThreadMode or rather when do we need to make a
Servlet thread safe(any examples ..). Any pointers are welcome.
TIA
Anamitra

___________________________________________________________________________
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

Reply via email to