well the purpose of pthread_join is to "join the created thread" into the caller thread...
this makes sure that your thread does get to run before the process falls off the closing brace in main.....
may be looked at vaguely as a sort of a wait for threads...
eg:
//code
#include <stdio.h>
#include <pthread.h>
void *func(void *arg)
{
printf ("inside the thread %d\n",pthread_self());
return NULL;
}
int main (void)
{
pthread_t tid;
pthread_create (&tid,NULLm func,NULL);
pthread_join (tid,NULL);
return 0;
}
------the above code guarantees that your thread gets a chance to run...
if you try the above code with out the pthread_join ...the thread may or may not get to run...
so....this is to make sure that your thread does run...
for more details see
http://campuscgi.princeton.edu/man?pthread_join
also go thru a book called advanced linux programming....freely available on the net (
http://www.advancedlinuxprogramming.com/)....it explains many of the nuances of the threads....