Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 79488 invoked from network); 30 May 2003 17:07:17 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 30 May 2003 17:07:17 -0000 Received: (qmail 22120 invoked by uid 97); 30 May 2003 17:09:32 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 22113 invoked from network); 30 May 2003 17:09:32 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 30 May 2003 17:09:32 -0000 Received: (qmail 78015 invoked by uid 500); 30 May 2003 17:06:58 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 78003 invoked from network); 30 May 2003 17:06:58 -0000 Received: from unknown (HELO warhawk.mpi.com) (63.244.250.133) by daedalus.apache.org with SMTP; 30 May 2003 17:06:58 -0000 Received: from lightning.mpi.com (lightning.mpi.com [63.244.252.11]) by warhawk.mpi.com (Switch-2.2.6/Switch-2.2.6) with ESMTP id h4UH6v601979 for ; Fri, 30 May 2003 13:06:57 -0400 (EDT) Received: from US-VS1.corp.mpi.com (us-be2.corp.mpi.com [199.93.195.21]) by lightning.mpi.com (Switch-3.0.4/Switch-3.0.0) with ESMTP id h4UH6Nmh022824 for ; Fri, 30 May 2003 13:06:58 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: How do I listen for threads starting and stopping? Date: Fri, 30 May 2003 13:06:54 -0400 Message-ID: <9C5166762F311146951505C6790A9CF8A6E5A2@US-VS1.corp.mpi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How do I listen for threads starting and stopping? Thread-Index: AcMmzQ5vUYRhZ9O7QFqMO35nyI16kgAAJrRg From: "Shapira, Yoav" To: "Tomcat Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Howdy, Just be very careful with ThreadLocal -- it's inherently evil and easy= to misuse. Consider the PooledExecutor from Doug Lea's util-concurrent package (which will become java.util.concurrent in J2SE 1.5, Doug Lea's the sp= ec lead for JSR 166) as an alternative: http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/i= nt ro.html Yoav Shapira Millennium ChemInformatics >-----Original Message----- >From: Kenneth H. Cox [mailto:tclunit@attbi.com] >Sent: Friday, May 30, 2003 1:00 PM >To: Tomcat Users List >Subject: Re: How do I listen for threads starting and stopping? > >Sorry; I was unclear. I'm planning to use TclBlend to start one >Tcl interpreter per thread (a Tcl interp cannot jump threads and >so cannot be pooled). Starting and initializing these interps is >somewhat heavyweight, so my plan was to keep them around until >Tomcat discards the thread or the thread dies of natural causes, >at which point I would like to be notified, so I can free my interp >(and the memory allocated by its native code). > >Unless (duh?) a ThreadLocal variable will do this for me. Yes, >it seems that it will. Thanks for kicking my brain back into gear. > >p.s. Any other Tomcat / TclBlend users out there? I'm hunting >for a combination of JDK/TclBlend/Tcl/Thread that play together. > >Ken > > >On Wed, 28 May 2003 22:00:56 -0700, Bill Barker >wrote: > >> The simplest (portable) way to do this is to pretend that Threads a= re the >> same as Requests, and use request.setAttribute("foo",bar). These will >> automatically be discarded (i.e. eligible for GC) at the end of the= >> Request. >> If you need to do explicit cleanup, then you have to wait for TC 5.= x, >> which >> has RequestListeners to tell you when the Request starts and ends. >> >> "Kenneth H. Cox" wrote in message >> news:oprpwig1cl3ocmvz@mail.attbi.com... >>> I have some per-thread data that I need to dispose of >>> when Tomcat connector thread goes away. I'm using the >>> Coyote Connector. Is there a way to do it? A Tomcat-specific >>> mechanism is just fine for now, thank you. >>> >>> I found HttpConnector.addLifecycleListener(), but all the >>> methods are marked deprecated and I'm not sure how to get at the >>> HttpConnector in the first place. >>> >>> Any pointers in the right direction would be greatly appreciated. >>> >>> Regards, >>> kenstir >>> >>> -- >>> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ >> >> >> >> >> -------------------------------------------------------------------= -- >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: tomcat-user-help@jakarta.apache.or= g >> >> > > > >-- >Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m= 2/ > >---------------------------------------------------------------------= >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org This e-mail, including any attachments, is a confidential business com= munication, and may contain information that is confidential, propriet= ary and/or privileged. This e-mail is intended only for the individua= l(s) to whom it is addressed, and may not be saved, copied, printed, d= isclosed or used by anyone else. If you are not the(an) intended reci= pient, please immediately delete this e-mail from your computer system= and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org