title: process id of threads in the same process
body: <p>The following code is for printing the process id of the 2 threads linux(ubuntu 14.04)</p>
  
  <pre><code>#include&lt;pthread.h&gt;
  #include&lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  void* thread_function (void* arg)
  {
      fprintf (stderr, "child thread pid is %d\n", (int) getpid ());
      /* Spin forever. */
      while (1);
      return NULL;
  }
  
  int main ()
  {
      pthread_t thread; 
      fprintf (stderr, "main thread pid is %d\n", (int) getpid ());
      pthread_create (&amp;thread, NULL, &amp;thread_function, NULL);
      /* Spin forever. */
      while (1);
      return 0;
  }
  </code></pre>
  
  <p>And the output is</p>
  
  <pre><code>main thread pid is 3614
  child thread pid is 3614
  </code></pre>
  
  <p>But shouldn't be the process id be different since GNU/Linux,threads are implemented as processes??</p>