according to my understanding, the TID
(thread id) returned by gettid()
is unique inside a process(or inside a program with multiple processes, while each process may have multiple threads), namely, inside a process, different thread has different thread id.
the TID
returned by pthread_self()
is unique across processes, namely, on the same machine, different thread has different TID
on the same machine at the same time.
Is my understanding correct or not?
besides, how can a thread get the TID
(corresponds to gettid()
) of its derived thread?
thanks!