Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 72115 invoked from network); 5 Jul 2000 16:47:13 -0000 Received: from mail1.navisite.net (HELO cliff.navisite.net) (207.252.81.12) by locus.apache.org with SMTP; 5 Jul 2000 16:47:13 -0000 Received: from cmgi03.cmgi.com (cmgi03.cmgi.com [206.25.88.118]) by cliff.navisite.net (8.9.1a/8.9.1) with ESMTP id MAA13961 for ; Wed, 5 Jul 2000 12:51:42 -0400 (EDT) Received: by cmgi03.cmgi.com with Internet Mail Service (5.5.2650.21) id ; Wed, 5 Jul 2000 12:45:24 -0400 Message-ID: <59F0A2716248D311B15700902789D5670117FEAF@cmgi03.cmgi.com> From: "MacLaren, Donald" To: "'tomcat-user@jakarta.apache.org'" Subject: RE: A threading question! Date: Wed, 5 Jul 2000 12:45:17 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N I used that same type of process except I had a class that was created in a servlet create the thread and send the e-mail. I found that this was the fastest and efficient way to send the mail notification without a delay in the response. -----Original Message----- From: Graham Stewart [mailto:GrahamStewart@btinternet.com] Sent: Wednesday, July 05, 2000 12:37 PM To: tomcat-user@jakarta.apache.org Subject: Re: A threading question! John >>Typically servlets should not spawn other threads. Can you elaborate - I've just started using servlets and have lots to learn. I currently have a servlet that spawns a thread to send email notofication. I didn't want the client to have to wait for the email processing to finish before sending back a response. Is this an OK thing to do? thanks Graham ----- Original Message ----- From: John Econopouly To: Sent: Wednesday, July 05, 2000 5:19 PM Subject: Re: A threading question! > > >From: William Brogden > >Lucas Ludvig wrote: > > > Can Tomcat handle threads that send output to two separate > > > HttpServletResponse objects "simultaneously"? Currently my simple > >threaded > > > program locks up and no output appears in the browser. Any input > > > appreciated greatly. > > > > > > >Certainly, thats the whole idea. The servlet engine activates a > >separate > >Thread for each HTTP request so as long as your servlet does not use > >instance variables there should be no interference. When you say "my > >simple threaded program" do you mean that you are starting another > >Thread? > >Simple servlets typically use the Thread provided by the servlet > >engine. > > I agree with the above comment. Typically servlets should not spawn > other threads. Also, I wanted to caution you not to try to use the > Response object outside of the service() method of the servlet (doGet() and > doPost() are part of service()), as this is undefined. > > > > ________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com > > > -------------------------------------------------------------------------- > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > For additional commmands, email: tomcat-user-help@jakarta.apache.org > -------------------------------------------------------------------------- To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org For additional commmands, email: tomcat-user-help@jakarta.apache.org