This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: libthread_db thread handles
- From: Michael Snyder <msnyder at redhat dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: Ulrich Drepper <drepper at redhat dot com>, Daniel Jacobowitz <drow at mvista dot com>, gdb at sources dot redhat dot com
- Date: Tue, 14 Jan 2003 16:16:34 -0800
- Subject: Re: libthread_db thread handles
- Organization: Red Hat, Inc.
- References: <200301142346.h0ENkp512697@magilla.sf.frob.com>
Roland McGrath wrote:
>
> > If you have the pthread_t value computing the td_thrhandle_t is an
> > operation which can be performed entirely without the looking at the
> > inferior. At least in the new implementation. Just call
> > td_ta_map_id2thr(). This shouldn't add any measurable overhead.
> >
> > I would prefer you caching the pthread_t value very much over caching
> > any opaque data structure. If this means adding a function
> > td_ta_map_thr2id() I'd have no problems with it. But not even this
> > should be necessary since for both events, TD_CREATE and TD_DEATH, the
> > eventdata is the pthread_t value. And this should be a documented
> > interface.
>
> One can already use td_thr_get_info and ti_tid is the pthread_t value (that
> can be given to td_ta_map_id2thr).
That's much better than using thr_unique.