3 ms·
OK, let's get things more straight: * Threads are useful not just for speeding up, but also for parallel execution (storege/network io, graphics, ...) * If yo
by dvfjsdhgfv 6y ago
OK, let's get things more straight:
* Threads are useful not just for speeding up, but also for parallel execution (storege/network io, graphics, ...)
* If you really care about speed and would like to parallelize CPU-bound code, you'll probably do better using another language like C/C++ (or Java, Go, D etc.) for this particular task
* In general, threads are used instead of processes because of the overhead involved in creating the latter
* Python multiprocessing module isn't the most efficient anyway, for example when passing large objects between processes because of the way they're serialized
* It also has some other quirks so I would definitely not advise to use it for "everything".