标签:des style blog color strong os
1.pthread_create function creates thread that share the same memory with the process.
2.pthread_join function wait for threads until they stop
3.The pthread_self function returns the thread ID of the thread in which it is
called;This thread ID may be compared with another thread ID using the
pthread_equal function
1 if (!pthread_equal (pthread_self (), other_thread)) 2 pthread_join (other_thread, NULL);
4.one of thread‘s important attribute is the detach state,which includes joinable state(default) and detached thread.the difference is that the joinable thread is not automatically cleaned up by GNU/Linux when it terminates,but needs pthread_join to do the clean up.A detached thread is just the opposite.
Even if a thread is created in a joinable state, it may later be turned into a detached thread.To do this, call pthread_detach . Once a thread is detached, it cannot be made joinable again.
advanced linux programming note,布布扣,bubuko.com
advanced linux programming note
标签:des style blog color strong os
原文地址:http://www.cnblogs.com/idiotshi/p/3851261.html