Q. What is Thread Local Storage (TLS) or Thread Private Data?
A. Thread Local storage is the part of memory of each thread, in which the variables are accessed by all functions belonging to that thread. It acts like a variables that are global and visible only to specific thread where it is defined.
Functions/data structures involved in creating TLS are
pthread_key_t key
pthread_key_create()
pthread_setspecific()
pthread_getspecific()