3 ms·
Rather, 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'
by BiteCode_dev 5y ago
Rather, 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