by est · 5y ago · 0 comments
In fact projects like uWSGI disables _thread.so by default.
Threads in Python are mostly useful to avoid blocking:
- you need to make io calls and don't want to bring asyncio
- you need to process things in the background without blocking the main thread (e.g: zippping things while you use a GUI)
- you want to run a long process on a c-extension based data structure (they release the gil, so you get the perf boots), such as a numpy array or a pandas DF