From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25279 invoked by alias); 14 Jan 2003 22:33:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25078 invoked from network); 14 Jan 2003 22:33:14 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by 209.249.29.67 with SMTP; 14 Jan 2003 22:33:14 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h0EM4lB30208 for ; Tue, 14 Jan 2003 17:04:47 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h0EMX0n20214; Tue, 14 Jan 2003 17:33:00 -0500 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id h0EMWxE22285; Tue, 14 Jan 2003 14:32:59 -0800 Message-ID: <3E24901B.4841796E@redhat.com> Date: Tue, 14 Jan 2003 22:33:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Daniel Jacobowitz CC: Mark Kettenis , gdb-patches@sources.redhat.com Subject: Re: RFA [threads]: Thread cache 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00542.txt.bz2 Daniel Jacobowitz wrote: > > On Mon, Jan 13, 2003 at 04:04:20PM -0800, Michael Snyder wrote: > > Daniel Jacobowitz wrote: > > > For instance, I'd like to know if I > > > can safely cache the thread handles across resumes; if I could, this > > > would be much much much much easier to do efficiently. We could get > > > the thread handle and LWP when the thread is created, and then hold the > > > thread handle, and optionally hold the LWP. I am pretty sure this is > > > safe given glibc, but I don't know in general. > > > > I think in general not. > > Hmm. The Solaris documentation suggests that this is valid; I have no > way to check whether it actually is, and there is no explicit > description of the lifetime of a thread handle, but it doesn't describe > them as being of limited life. It's a handle to "the thread object" > itself. Dan, I passed your question along to Ulrich Drepper, and he says that, if by "thread handle" you mean the th_unique value, then yes, those are persistant until the thread exits. If you mean the td_thrhandle_t value, though, then no, they are not persistant. They are allocated by libthread-db as needed, then thrown away.