Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

About thread of servlet instance

Posted on 2006-10-29
5
Medium Priority
?
260 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
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 15 hours left to enroll

916 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