SKGaur's Blog

January 25, 2010

make a choice pthread_join or pthread_detach

Filed under: Uncategorized — sumitkgaur @ 10:22 am
Tags:

Depends if you want to get some sort of status code or return value from the thread. If the thread doesn’t need to signal any errors (or it signals errors in some other way than the return code), then using detach is preferable since it (slightly) reduces overhead. If you want to get the return code from the thread, then you need to use pthread_join. pthread_join is also useful for making sure than another thread has finished it’s work.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.