title: pthread runs multiple times
body: <p>I want my each of my threads call multiple functions. How can I achieve that? Right now I have code for threads calling just one function:</p>
  
  <pre><code>pthread_attr_init(&amp;attributes);
  if((tid1 = pthread_create(&amp;thread[0],&amp;attributes,produce,NULL)))
  {
      printf("\nError in the producer thread\n");
      printf("\n");
  }
  
  if((tid2 = pthread_create(&amp;thread[1],&amp;attributes,consume,NULL)))
  {
      printf("\nERror in the consumer thread\n");
  }
  
  pthread_join(thread[0],NULL);
  pthread_join(thread[1],NULL);
  </code></pre>
  
  <p>Would calling pthread_create spawn two new threads? </p>