4 ms·
tl;dr don't use threading in CPython unless you know what you are doing. In fact projects like uWSGI disables _thread.so by default.
by est 5y ago
tl;dr don't use threading in CPython unless you know what you are doing.
In fact projects like uWSGI disables _thread.so by default.
- BiteCode_dev 5y agoRather, don't use threading for the sake of parallelism in Python. 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