3 ms·
> Look at your program's CPU usage. If the sum of your threads is <100% of one core, then there is no reason whatsoever for you to use threads. If your program
by ebg13 6y ago
> Look at your program's CPU usage. If the sum of your threads is <100% of one core, then there is no reason whatsoever for you to use threads. If your program is not CPU bound, then you would be infinitely wiser to use an event loop1 or coroutines2. If you are not CPU bound, then the entire value proposition of threads does not apply to you.
Ok. Give me a non-thread-based solution in Python that can parallelize IO-bound tasks as easily, universally, and naturally as throwing in 3 lines of concurrent.futures.ThreadPoolExecutor and concurrent.futures.as_completed.
- therealdrag0 6y agoOoh I didn’t k ow python had this functionality! Kinda nice they reused existing vernacular too!