title: difference between the value returned by pthread_self() and gettid()
body: <p>according to my understanding, the <code>TID</code>(thread id) returned by <code>gettid()</code> 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.</p>
  
  <p>the <code>TID</code> returned by <code>pthread_self()</code> is unique across processes, namely, on the same machine, different thread has different <code>TID</code> on the same machine at the same time.</p>
  
  <p>Is my understanding correct or not?</p>
  
  <p>besides, how can a thread get the <code>TID</code>(corresponds to <code>gettid()</code>) of its derived thread?
  thanks!</p>