I am reading the Threads in OS concepts and i come across "thread local storage (TLS)". What I understood is that the TLS is similar to static or global data, but it is more unique to individual thread. Its bit confusing on what is unique here?
Why can't we pass the data through runner (i.e., thread's actual codes) functions as params to this function?
Why can't we pass the data ... as params to this function?
- Such a way you will have data local to given function, while TLS implements global data. Local and global data are alternatives, each has its own prop. and cons. – Tsyvarev