Ok,
I've search the archive looking to see if anyone has "talked" about this
before, but I didn't see any postings. So I'm going to ask. I'm developing
a servlet that I want to have multi-threading support in. I thought if I
made the servlet multi-threaded the servlet engine would create a new
thread/instance for each person "hitting" my servlet. But from some of the
other posts I've seen this isn't the case, unless I use the single threaded
model. But from the same posts, it sounds like that is going to be a
performance hit. Question: will I get the same performance hit if I do the
threading myself? Example:
void doGet(HttpServletRequest req, HttpServletResponse resp)
{
Runnable objectToHandleRequest = new RunnableObjectToHandleRequest(req,
resp);
Thread newThread = new Thread(objectToHandleRequest );
newThread.start();
}
In this way I'm sure I have all my variables and objects within one thread
where I can control the accessing/changing data. And I can have one
database connection per thread.
Is this a bad idea or a good idea?
Thanks,
Jeff
___________________________________________________________________________
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