[LCP]pthread_join Vs pthread_detach

Jack Lloyd lloyd at acm.jhu.edu
Tue Dec 17 21:22:01 UTC 2002


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.

On 17 Dec 2002, mehul radheshyam choube wrote:

> hi all,
>  	pthread_join Vs pthread_detach. which method is superior?
>
> mehul.
>
> _______________________________________________
> This is the Linux C Programming List
> :  http://lists.linux.org.au/listinfo/linuxcprogramming List
>




More information about the linuxCprogramming mailing list