Single Thread Model
1 posts in topic
Flat View  Flat View

Posted By:   Nilesh_Chandorkar
Posted On:   Tuesday, April 2, 2002 08:43 PM

What is Single thread model with respect to servlets

Re: Single Thread Model

Posted By:   Thomas_Hackel  
Posted On:   Wednesday, April 3, 2002 01:24 AM

every request to the servlet is done with the SAME instance of the servlet. when you set a variable in one request, an other request can read this variable, without using session attributes. i do not recommend to use the SingleThreadModel because its not safe to program, it's the same like writing threadsafe classes. every request = a new instance , is the best approach for avoiding mistakes. using synchronized methods is slow and not good at all, avoid this :)
About | Sitemap | Contact