If I call pthread_join continuous which will cause a Segmentation fault. I can solve the problem by inserting a sleep(); , printf() or anything else be
sleep();
printf()