What does thread local mean in Flask framework? [duplicate] What does thread local mean in Flask framework? [duplicate] flask flask

What does thread local mean in Flask framework? [duplicate]


It's not really a scalability issue, rather it can make it more difficult to maintain a complex code-base. This is because thread locals are used as a global data store, to avoid passing state via function arguments, which makes it harder to follow what's going on.

Speed-wise, thread locals are not particularly slow, but they do make it hard or impossible to use an asynchronous framework, where lots of tasks run for short amounts of time on a single thread.