This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: libthread_db thread handles
- From: Roland McGrath <roland at redhat dot com>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: Daniel Jacobowitz <drow at mvista dot com>,Michael Snyder <msnyder at redhat dot com>, gdb at sources dot redhat dot com
- Date: Tue, 14 Jan 2003 15:46:51 -0800
- Subject: Re: libthread_db thread handles
> 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).