Does the streaming local middle thread match?

In particular, I'm talking about Python. I am trying to hack something (a bit) by seeing the value of an object without passing it, and I am wondering if it is thread-safe to use thread local for this. Also, how do you do this at all?

+4
source share
1 answer

No - thread local means that each thread receives its own copy of this variable. Using it (at least normally) is thread safe, simply because each thread uses its own variable, separate from variables with the same name that are available to other threads. OTOH, they are not (usually) useful for communication between threads.

+7
source

All Articles