There have been questions asked before on this topic , but still I'm not very clear with the usage of pthread_join().
I read somewhere that resources are not cleaned up when a thread exists without getting joined with the main thread . What are the resources we are talking about? If these resources are present in the stack of the calling thread , wont they be cleared up when the calling thread exists? So I think pthread_join() helps clean up the resources which are present in the heap ? Also what is the advantage of using pthread_exit()?