Thread specific storage APIs

Thread specific storage is used by your threaded application when you need global storage that is `private' to a thread. The storage is allocated and stored by the thread, and can be associated with a destructor function. When the thread ends using one of the pthread mechanisms, the destructor function runs and cleans up the thread local storage. The thread specific storage can replace global storage, because any function in a thread that requests the thread specific storage will get the same value. Functions in another thread that request the thread specific storage will get the thread specific storage owned by the thread that they are called in.

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

The thread specific storage APIs are:


Pthread APIs | APIs by category