Thread management APIs

Thread management APIs allow a program to manipulate threads. The APIs actually create, destroy and otherwise manage the active or ended threads within the application. The APIs allow the manipulation of some of the thread attributes of an active thread.

A program can also setup or change the characteristics of a thread attributes object. The thread attributes object is used at thread creation time. The new thread is created with the attributes that are specified in the attributes object. After the thread has been created, the attributes object is no longer required.

The table below lists important thread attributes, their default values, and all supported values.

Attribute Default value Supported values
detachstate PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_JOINABLE
PTHREAD_CREATE_DETACHED
schedparam SCHED_OTHER with priority equal to PRIORITY_DEFAULT (0) SCHED_OTHER with priority <= PTHREAD_PRIO_MAX and priority >= PTHREAD_PRIO_MIN
contentionscope PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_SYSTEM
inheritsched PTHREAD_EXPLICIT_SCHED, priority equal PRIORITY_DEFAULT (0) PTHREAD_EXPLICIT_SCHED or PTHREAD_INHERIT_SCHED
schedpolicy SCHED_OTHER SCHED_OTHER

For information about the examples included with the APIs, see Information about the Pthread API examples.

The thread management APIs are:


[ Back to top | Pthread APIs | APIs by category ]