Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Roland McGrath <roland@redhat.com>
Cc: Michael Snyder <msnyder@redhat.com>,
	Ulrich Drepper <drepper@redhat.com>,
	gdb@sources.redhat.com
Subject: Re: libthread_db thread handles
Date: Tue, 14 Jan 2003 23:07:00 -0000	[thread overview]
Message-ID: <20030114230733.GA996@nevyn.them.org> (raw)
In-Reply-To: <200301142300.h0EN0wi09118@magilla.sf.frob.com>

On Tue, Jan 14, 2003 at 03:00:58PM -0800, Roland McGrath wrote:
> > td_thrhandle_t is opaque; it is documented as opaque in <thread_db.h>. 
> > 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


  reply	other threads:[~2003-01-14 23:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030110204624.GA32002@nevyn.them.org>
     [not found] ` <86wulbc29o.fsf@elgar.kettenis.dyndns.org>
     [not found]   ` <20030113214916.GA18517@nevyn.them.org>
     [not found]     ` <3E235404.45568034@redhat.com>
     [not found]       ` <20030114002758.GA30705@nevyn.them.org>
     [not found]         ` <3E24901B.4841796E@redhat.com>
2003-01-14 22:46           ` Daniel Jacobowitz
2003-01-14 23:01             ` Roland McGrath
2003-01-14 23:07               ` Daniel Jacobowitz [this message]
2003-01-14 23:08             ` Ulrich Drepper
2003-01-14 23:20               ` Daniel Jacobowitz
2003-01-14 23:41                 ` Ulrich Drepper
2003-01-14 23:47                   ` Roland McGrath
2003-01-15  0:16                     ` Michael Snyder
2003-01-14 23:56                   ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030114230733.GA996@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=drepper@redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=msnyder@redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox