From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2000 invoked by alias); 14 Jan 2003 23:20:12 -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 1983 invoked from network); 14 Jan 2003 23:20:10 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 209.249.29.67 with SMTP; 14 Jan 2003 23:20:10 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18YcER-0001Ff-00; Tue, 14 Jan 2003 19:20:39 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18YaMC-0002JN-00; Tue, 14 Jan 2003 18:20:32 -0500 Date: Tue, 14 Jan 2003 23:20:00 -0000 From: Daniel Jacobowitz To: Ulrich Drepper Cc: Michael Snyder , Roland McGrath , gdb@sources.redhat.com Subject: Re: libthread_db thread handles Message-ID: <20030114232032.GA3774@nevyn.them.org> Mail-Followup-To: Ulrich Drepper , Michael Snyder , Roland McGrath , gdb@sources.redhat.com References: <20030110204624.GA32002@nevyn.them.org> <86wulbc29o.fsf@elgar.kettenis.dyndns.org> <20030113214916.GA18517@nevyn.them.org> <3E235404.45568034@redhat.com> <20030114002758.GA30705@nevyn.them.org> <3E24901B.4841796E@redhat.com> <20030114224641.GA18618@nevyn.them.org> <3E249864.2060600@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E249864.2060600@redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-01/txt/msg00246.txt.bz2 On Tue, Jan 14, 2003 at 11:08:20PM +0000, Ulrich Drepper wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Daniel Jacobowitz wrote: > > > First of all, libthread_db doesn't necessarily create the > > td_thrhandle_t; they're allocated by the caller of libthread_db, for > > map_id2thr and map_lwp2thr. The iterators create them and then throw > > them away, of course. > > ...which is why you cannot reply on the addresses of these objects to > have any relevance. This is why I mentioned it. OK. I understand; I don't expect the addresses to be relevant. > > 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? > > In the current implementation this is the case but I don't want to > commit to this unless you can show me there are big benefits. It would > help if you could describe what functions you see being used often and > in which contexts. There are things in the libthread_db implementation > which can be changed without breaking the ABI. We just need to know how > you use the library. To find the state of a thread, we need to first get a thread handle for it and only then can we call td_thr_get_info. I'd like to save a copy of the td_thrhandle_t when we get the TD_CREATE event, and be able to hand it to td_thr_get_info until I see a TD_DEATH event (can a thread die without us getting the TD_DEATH event? Is there some other thing we should be watching for a thread to vanish?). This can be a major timesaver, in addition to caching the LWP ID and holding on to it as long as we know we've got a 1-to-1 mapping (via not seeing any TD_SWITCHTO/TD_SWITCHFROM). If you're not comfortable with it, let me know and I'll figure out whether I can get the same effect another way. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer