Thread Local Data
By using the keyword thread_local
, you have thread local data also known as thread local storage. Each thread has its copy of the data. Thread-local data behaves like static variables. They are created at their first usage, and their lifetime is bound to the lifetime of the thread.
Each thread has its copy of the thread_local
string, therefore, each string s
modifies its string independently...