944,134 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 2431
  • C RSS
Apr 6th, 2007
0

Using/Omitting pthread_join()

Expand Post »
When programming with pthreads, you pass the thread a function to run when you create it. When this function is done, is the thread cleaned up automatically? Is it necessary to put pthread_join() in the calling function somewhere? Is pthread_join only useful when you want to wait for a thread to finish?
Similar Threads
Reputation Points: 36
Solved Threads: 2
Junior Poster in Training
nanodano is offline Offline
78 posts
since Feb 2005
Aug 10th, 2007
0

Re: Using/Omitting pthread_join()

You should always kill the threads as the finish up the work. So you need to join the thread in order to stop it. Threads can provide significant overhead if left to run wild so make sure you clean up all threads in your exit handler.
Reputation Points: 10
Solved Threads: 3
Light Poster
mcldev is offline Offline
31 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: type mismatch in redeclaration of 'square' ( function )
Next Thread in C Forum Timeline: help writing a string to textfile with fprintf





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC