ML

MULTIPROCESSING VS. THREADING

As with threading, there are still drawbacks with multiprocessing ... you've got to pick your poison: 1. There is I/O overhead from data being shuffled around between processes 2. The entire memory is copied into each subprocess, which can be a lot of overhead for more significant programs ## [What Should You Use?](https://timber.io/blog/multiprocessing-vs-multithreading-in-python-what-you-need-to-know/#what-should-you-use-) If your code has a lot of I/O or Network usage: * Multithreading is your best bet because of its low overhead If you have a GUI * Multithreading so your UI thread doesn't get locked up If your code is CPU bound: * You should use multiprocessing (if your machine has multiple cores)