Hoang Luu wrote:

>
>
> I'm new to servlets and I have the following questions.
>
> 1) I read that the servlet engine only creates one instance of a
> servlet and it will spawn new threads for each subsequent requests.
> Is this true?
>
> 2) Also, the servlet engine will retain a pool of threads to reuse
> them for each request and not create new thread each time.  Is it true
> and do you know what is the number of threads in this pool that the
> serlvet engine creates?
>
> 3) When does the servlet engine create this number of threads and put
> them in a pool? Is it after the first request or before it?
>

There are no general answers to most of these questions -- the
implementation details depend very much on which servlet engine you are
running.  You will need to check the documentation (or source code) of
each engine specifically.  The constant across servlet engines is that
there is only one instance of your servlet class, per servlet definition
in the configuration files, unless your servlet implements
SingleThreadModel.  In that case, the servlet engine *may* support a
pool of instances to increase performance, but it is not required to.

>
> Thanks,
> -Hoang

Craig McClanahan

___________________________________________________________________________
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