Threads
Overview
A thread is a one of possibly many execution units within a process.
A function is said to be thread-safe if and only if it always produces correct results when called repeatedly from multiple concurrent threads. Otherwise it is thread-unsafe. Reentrant functions are a subclass of thread-safe functions characterized the the property that they do not reference any shared data.
Contention
Contention refers to performance degradation because two threads access shared resources. Starvation refers to situations in which threads are unable to access shared resources and therefore are unable to make progress.
Deadlock refers to a situation in which two or more threads are blocked on one another. Livelock refers to a situation in which two or more threads cannot progress because their states constantly change with regard to one another.
Storage
Thread-Local Storage
Thread-Local Storage (TLS) is a memory management method that uses static or global memory local to a thread.
Thread-Specific Data
Thread-specific data (TSD) refers to a dynamically managed per-thread storage manipulated with an API. This often involves using a key global to the process, but by which each thread can retrieve its own copy of the associated data.