Trying to use threading.local()

Antoon Pardon antoon.pardon at vub.be
Thu Sep 13 06:21:26 EDT 2018


On 12-09-18 22:14, Peter Otten wrote:
> As I understand it you need one local() instance that is shared by all 
> workers. Every thead will then see thread-specific values.

It has always puzzled me how this is useful. The times I work with threads,
I just put thread specific values in the local variables of the thread function.

What is gained by using threading.local instances?

-- 
Antoon Pardon





More information about the Python-list mailing list