This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Single Thread Model

 
gurusamy sengodan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In Servlet 2.3 , Single Thread Model is deprecated why?
Can you explain?

Thanks in Advance
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it puts limitations on capability of a servlet.If a programmer needs a thread safety for a code, then he goes for synchronize block or method.
 
anand bajaj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because singleThreadModel sucks performance of Web Application. New instance of the servlet is created for every request which is costlier process besides creating a new thread of the same servlet instance.

So.. bottomline.. SingleThreadModel drastically influence the performance of Application
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, if pooled (as Tomcat does) the performance of SingleThreadModel servlets can be quite good.

They were deprecated because the name was somewhat misleading.
Just implementing SingleThreadModel doesn't guarantee that there will be no concurrency issues to watch for.

If you search this forum you will find numerous, long, detailed discussions about SingleThreadModel.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SingleThreadModel was used early in the development of Java servlets, before people had figured out better ways of keeping each user's data separated. You have to realize what a big jump it was conceptually to go from coding single user desktop applications to the multiple user web applications - it took a while to come up with appropriate approaches - thats why there have been so many iterations of the servlet API.
Bill (with historian hat on)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!