+ 1

Why are the two code efficiencies not much different?

https://code.sololearn.com/ct0ZLCCl5oWE/?ref=app Is this code using multithreading for arithmetic? https://code.sololearn.com/cUnKj6lA1i85/?ref=app

9th Aug 2018, 11:24 AM
acoco
1 Answer
0
Sorry, this is a very late response. I don't know too deeply about threads, but I'm pretty sure there isn't much change in performance for this kind of problem. Threads in python don't really provide parallelism. Although, they can be really useful in I/O tasks. What you might want to check out is the multiprocessing module. Afterwards, search google for Pool and Map in multiprocessing and the concurrent.futures package. specifically for both: concurrent.futures.ThreadPoolExecutor concurrent.futures.ProcessPoolExecutor Each and every way of using both threading and multiprocess have their use, be sure to study up each of them, and see what might be useful to you. (Note: use multiprocessing in your own PC)
25th Feb 2020, 9:38 PM
LDSD
LDSD - avatar