Blog Archive

GNU Linux pthreads

pthread_t (object)
pthread_attr_t (object) --- pthread_attr_init,pthread_attr_destroy
Thread’s detach state.A thread may be created as a joinable
thread (the default) or as a detached thread.
pthread_attr_setdetachstate
pthread_detach

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.

pthread_create

pthread_self
pthread_equal



pthread_exit
pthread_cancel --> PTHREAD_CANCELED
A canceled thread may later be joined; in fact, you should join
a canceled thread to free up its resources, unless the thread is
detached
asynchronously cancelable.
synchronously cancelable - cancellation points.The thread will
queue a cancellation request until it
reaches the next cancellation point.
uncancelable
pthread_setcanceltype
PTHREAD_CANCEL_ASYNCHRONOUS OR PTHREAD_CANCEL_DEFERRED
pthread_testcancel - direct way to create a cancellation point
- process a pending cancellation in a
synchronously cancelable thread.
pthread_key_t(object) --- pthread_key_create,pthread_setspecific,pthread_getspecific

thread-specific data area.
pthread_join

No comments: