Thread Local Data
In this lesson, we will learn about data that is bound to the lifecycle of a thread.
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.