python difference between multiprocessing Pool and Threadpool code example
Example 1: python difference between multiprocessing pool and threadpool
multithreading uses seperate python interpreters as processes,
which do NOT share memory, but can achieve higher performance
cuz every process has its own cpu usage limit!
multithreading is just useful to seperate i/o tasks and other stuff that is not
cpu intensive from the main process to continue working while the seperated thread waits for
something to happen
Example 2: python difference between multiprocessing Pool and Threadpool
The multiprocessing.pool.ThreadPool behaves the same as the multiprocessing.Pool with the only difference that uses threads instead of processes to run the workers logic.