3 ms·
I've been recently reading up on multithreading and multiprocessing in python. You mention that you've taken a multi threaded approach since the processes are i
by krishadi 3y ago
I've been recently reading up on multithreading and multiprocessing in python. You mention that you've taken a multi threaded approach since the processes are i/o bound. Is this the same as running the script with asyncio as async/await?
- krishadi 3y agoOops, I meant to ask the author but realised that the author is not the same as the op. Hah!
- Jorge1o1 3y agoAt a 10,000 foot view (pedants will take offense) you should look to use multiprocessing for tasks which are CPU bound, and asyncio/threads (but really asyncio if you can) for problems which are IO-bound. This is a massive simplification but most useful for a beginner. Additionally, asyncio is not the same as multithreading, because typically asyncio is powered by a single-threaded event loop and use of a mechanism like select/kqueue/IOCP/epoll.