tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: multi threading in tomcat
Date Sat, 11 Aug 2001 16:13:07 GMT


On Sat, 11 Aug 2001, Rob S. wrote:

> > and I need to find out a little about the inner workings of its
> > 'engine'. I've looked through some of the source code and the
> 
> -> ^^^^^^ hahaha!  I can picture Chris Farley putting finger "quotes" around
> that word.  "I might not use "silverware" or "take baths" =)  Anyway...
> 
> > each request have a unique thread of execution. In the later
> > case, is it necessary to make your application thread safe while
> > using tomcat as a front end?
> 
> Actually, the question you're asking is irrespective of the container you're
> running, it's part of how JSPs and servlets work.  You can either have them
> accessible concurrently (the default) or not, by setting a <%@ page %>
> attribute in JSP or having your servlet implement the SingleThreadModel
> marker.
> 

Note:  SingleThreadModel does *not* solve all of your thread safety
concerns, because it is still easy to have multiple requests accessing the
same session.  Therefore, I recommend that it not be used - newbies should
learn how to do it right the first time.

> - r
> 
> 

Craig



Mime
View raw message