On Tue, 6 Jul 1999, Kevin Jones wrote:
[ ... ]
> SingleThreadModel could be used to limit the number of threads in
> your servlet service method to one - this has limitations however -
> the most obvious being that you severely limit the scalability of
> your servlet, you will nearly always be better off understanding and
> managing the threading issues yourself rather than let the servlet
> engine do it (which is the effect of SingleThreadModel). Also,
> SingleThreadModel may not give you exactly what you want - it limits
> the number of threads in an instance of a servlet, a servlet engine
> could have more than one instance of a servlet managing requests for
> this web server (unlikely but possible), or could have multiple
[ ... ]
Actually, it's very likely. I believe most/all servlet engines deal
with SingleThreadModel (i.e. the performance/scalability issues you
mention) by creating a pool of servlet instances. As you suggest,
this is a bit unintuitive, and could lead to other thread-related
concerns. As some have posted here (e.g. Craig McLanahan and Hans
Bergsten), SingleThreadModel doesn't really help you with threading
issues as much as you might think, and is not really a good substitute
for good design and limited appropriate use of "synchronized".
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
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