RFC: A way to get a TID from a pthread_t handler

Florian Weimer fweimer@redhat.com
Mon Jan 15 19:54:55 GMT 2024


* Adhemerval Zanella Netto:

> Not really, mainly because I am not fully convinced that returning the
> TID is really a good idea.  It means that we will have two unique
> identifiers for a pthread thread that might eventually get out of sync
> (which would require us to add some support to return the correct value),
> and it is API deviation that need some justification (since pthread was
> defined as pthread_t being a opaque identifier).

I think this point is largely moot because we already provide this
information through pthread_getcpuclockid.  Applications can call this
function and reverse the encoding to get the TID.  We might as well make
this explicit, so that it's clearer that the application is asking for
the TID.

Thanks,
Florian



More information about the Libc-help mailing list