title: Order of running threads in pthreads
body: <p>In the following program, what are the possibilities for the ordering of threads? Assuming "function" will print thread id which is unique (since here we have only one process). I always get the order th1,th2!</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;pthread.h&gt;
  int main()
  {
              pthread_t th1;
              pthread_t th2;
              pthread_create(&amp;th1, NULL, function, NULL);
              pthread_create(&amp;th2, NULL, function, NULL);
              pthread_join(th1, NULL);
              pthread_join(th2, NULL);
  }
  
     return 0;
  }
  </code></pre>