I am a newbie Python programmer. I interested in parallel and concurrent programming. I understand the difference between process and thread but I confused about how multiprocessing and threading work. If my program A is -
from multiprocessing import Process for i in range(50): p = Process(target=worker) p.start() Does it will generate 50 processes on 1 CPU or distribute on 4 CPUs (my laptop has 4 CPUs 2 Cores) and same question but change program A to program B my program B is -
from threading import Thread for i in range(50) t = Thread(target=worker) t.start() In program B all threads depend on 1 process or not?
Explain this to me, please. Thank you.