Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 65318 invoked from network); 30 May 2003 17:00:56 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 30 May 2003 17:00:56 -0000 Received: (qmail 21972 invoked by uid 97); 30 May 2003 17:03:10 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 21965 invoked from network); 30 May 2003 17:03:10 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 30 May 2003 17:03:10 -0000 Received: (qmail 62953 invoked by uid 500); 30 May 2003 17:00:26 -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 62881 invoked from network); 30 May 2003 17:00:25 -0000 Received: from unknown (HELO mailgw1.syncinc.com) (63.126.54.34) by daedalus.apache.org with SMTP; 30 May 2003 17:00:25 -0000 Received: from ken (ken.synchronicity.com [10.1.1.103]) by mailgw1.syncinc.com (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0HFP00E71LVNX5@mailgw1.syncinc.com> for tomcat-user@jakarta.apache.org; Fri, 30 May 2003 12:59:47 -0400 (EDT) Date: Fri, 30 May 2003 13:00:26 -0400 From: "Kenneth H. Cox" Subject: Re: How do I listen for threads starting and stopping? In-reply-to: To: Tomcat Users List Message-id: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-15; format=flowed Content-transfer-encoding: 7BIT User-Agent: Opera7.03/Win32 M2 build 2670 References: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 are 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.org > > -- 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.org