Daily bit(e) of C++ | thread_local
Daily bit(e) of C++ #323, Storage specifier for variables whose lifetime is bound to the lifetime of a thread: thread_local.
Variables with the thread_local storage specifier do not follow the regular variable lifetime. Instead, they are constructed before (typically at) their first ODR use and destroyed at thread exit.
Thread local variables do not suffer the initialization overhead of static variables. A "thread local" variable is only accessible from a single thread (each thread gets its copy).