thread-local

Why is using thread locals in Django bad?

Why is using thread locals in Django bad? Question: I am using thread locals to store the current user and request objects. This way I can have easy access to the request from anywhere in the programme (e.g. dynamic forms) without having to pass them around. To implement the thread locals storage in a middleware, …

Total answers: 4

What is "thread local storage" in Python, and why do I need it?

What is "thread local storage" in Python, and why do I need it? Question: In Python specifically, how do variables get shared between threads? Although I have used threading.Thread before I never really understood or saw examples of how variables got shared. Are they shared between the main thread and the children or only among …

Total answers: 6