Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

About thread of servlet instance

Posted on 2006-10-29
5
Medium Priority
?
258 Views
Last Modified: 2010-04-01
According to my understanding, the system makes a single instance of our servlet and then creates a new thread for each user request.
When the a specific request is completed, will the thread that handle that request being deleted? Why?
0
Comment
Question by:william007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Author Comment

by:william007
ID: 17830323
Hi, thanks for posting so many links, but I just want to know will the thread being deleted when the request ended or it will be continue there for use by the other request?
0
 
LVL 10

Assisted Solution

by:jaggernat
jaggernat earned 400 total points
ID: 17831192
Once the request ends, the servlet assigns the thread to process the next request.
When a system removes a servlet, it runs the servlet's destroy method. However, When the destroy method runs,  other threads might be processing service requests.
0
 
LVL 8

Accepted Solution

by:
reach2piyush earned 1600 total points
ID: 17831576
- Thread handling is not a part of Servlet specifications, so the behaviour can vary for different Servers.

- Most Servers do maintain a pool of threads for the request, here is a excerpt from Tomcat documentation

At server startup time, this Connector will create a number of request processing threads (based on the value configured for the minProcessors attribute). Each incoming request requires a thread for the duration of that request. If more simultaneous requests are received than can be handled by the currently available request processing threads, additional threads will be created up to the configured maximum (the value of the maxProcessors attribute). If still more simultaneous requests are received, they are stacked up inside the server socket created by the Connector, up to the configured maximum (the value of the acceptCount attribute. Any further simultaneous requests will receive "connection refused" errors, until resources are available to process them.

From: http://tomcat.apache.org/tomcat-4.1-doc/config/coyote.html
0
 
LVL 9

Author Comment

by:william007
ID: 17853555
Thanks=)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question