From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25656 invoked by alias); 14 Jan 2003 23:07:11 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 25607 invoked from network); 14 Jan 2003 23:07:09 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 209.249.29.67 with SMTP; 14 Jan 2003 23:07:09 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18Yc1r-0001DX-00; Tue, 14 Jan 2003 19:07:39 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18Ya9d-0000Gd-00; Tue, 14 Jan 2003 18:07:33 -0500 Date: Tue, 14 Jan 2003 23:07:00 -0000 From: Daniel Jacobowitz To: Roland McGrath Cc: Michael Snyder , Ulrich Drepper , gdb@sources.redhat.com Subject: Re: libthread_db thread handles Message-ID: <20030114230733.GA996@nevyn.them.org> Mail-Followup-To: Roland McGrath , Michael Snyder , Ulrich Drepper , gdb@sources.redhat.com References: <20030114224641.GA18618@nevyn.them.org> <200301142300.h0EN0wi09118@magilla.sf.frob.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200301142300.h0EN0wi09118@magilla.sf.frob.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00243.txt.bz2 On Tue, Jan 14, 2003 at 03:00:58PM -0800, Roland McGrath wrote: > > td_thrhandle_t is opaque; it is documented as opaque in . > > I don't want to look at th_unique. Can I rely on the fact that the contents > > of a td_thrhandle_t are stable and can be re-used if I save the > > td_thrhandle_t? > > For the life of the td_thragent_t, yes. That is, until there is a TD_DEATH > event for the thread. Once you resume the LWP that stopped to report the > TD_DEATH event, any td_thrandle_t associated with the dying thread is > invalid (as you would expect). Since the closest thing to a spec for > thread_db is the Solaris documentation, and that's vague, we can't quite > say that this is "part of the spec". But in extant GNU/Linux > implementations it is certainly true, and I can't envision an > implementation in which it would not be true. Thank you. That's exactly what I was trying to get. We still need to hold onto the thread after TD_DEATH (or pthread_detach'ing; we haven't really started handling that right yet...) but at that point we don't need the td_thrhandle_t any more; we can just track the LWP itself. Michael/Mark: I can use this to be much more efficient in the caching. I'll get back to it when I have a chance to. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer