Thread-Specific Storage

From Wikipedia, the free encyclopedia

Thread specific storage is used by threaded applications that require global storage, but also require it to be local to their thread. The storage space is allocated for that thread, and the stored data placed in it. Any function in that thread that requests the thread specific storage will get the same value. This concept is also called thread-local storage.

[edit] Similarities to Other Patterns

Thread specific storage is similar to global storage, since any function in the same thread will get the same value when requesting the thread specific storage. However, unlike global storage, functions in another thread will not get the same value. Rather, they will get their own thread's thread specific storage value.

[edit] Alternate Definitions

Thread specific storage could also refer to the private virtual address space of a running task.