title: How can multiple threads have the same thread ID?
body: <p>I've got a question: can multiple threads have the same thread_id? (Of course not.) But my code is doing so. How is this possible?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;unistd.h&gt;
  #include&lt;pthread.h&gt;
  #include&lt;sys/types.h&gt;
  
  void* message(void* var){
      int t = (int)var;
  
  
      printf("\n%d- Hi I'm thread ID=%lu\n",t+1,(int unsigned long)pthread_self());
  }
  
  int main(void){
      pthread_t threads[10];
      int report[10];
      for(int i=0;i&lt;10;i++){
          report[i] = pthread_create(&amp;threads[i],NULL,message,(void*)i);
          pthread_join(threads[i],NULL);
      }
      return 0;
  }
  </code></pre>
  
  <p>My code at (Ubuntu 17.04) showing this result </p>
  
  <pre><code>1- Hi I'm thread ID=3076250432
  
  2- Hi I'm thread ID=3076250432
  
  3- Hi I'm thread ID=3076250432
  
  4- Hi I'm thread ID=3076250432
  
  5- Hi I'm thread ID=3076250432
  
  6- Hi I'm thread ID=3076250432
  
  7- Hi I'm thread ID=3076250432
  
  8- Hi I'm thread ID=3076250432
  
  9- Hi I'm thread ID=3076250432
  
  10- Hi I'm thread ID=3076250432
  </code></pre>