For example:
#include <thread> thread_local int n = 1; void f() { ++n; // is n initialized here for each thread or prior to entering f()? } int main() { std::thread ta(f); std::thread tb(f); ta.join(); tb.join(); } It's still not entirely clear from here when is n initialized.