multithreading - What is thread local storage? Why we need it? -


i reading threads in os concepts , come across "thread local storage (tls)". understood tls similar static or global data, more unique individual thread. bit confusing on unique here?

why can't pass data through runner (i.e., thread's actual codes) functions params function?

let's supposed working in ada. in ada program define task (thread) includes [static] variable can accessed task. create multiple instances of task. need copy of [static] variable each task.

that's implementation use thread local storage. in other words, static area of memory gets copied each thread in program.

as alternative tls, thread allocate such storage @ top of stack.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -