I tried to use multiprocessing for a simple code in windows 10, python2.7 and jupyter notebook. When I run the code the kernel got stack without any errors thrown. I checked the task manager for performance and saw 8 (the number of cores in my CPU) processes running with 0% use of the CPU for each and everyone of them. I looked almost everywhere but didn't find anything. I also tried it in the anaconda prompt but got endless loop of errors.
Here is my code:
import multiprocessing
n_cpu = multiprocessing.cpu_count()
def foo(x):
return x**2
if __name__ == '__main__':
pool = multiprocessing.Pool(processes = n_cpu)
res = pool.map(foo, [1,2,3])
pool.close()