I've recently switched from my MacBook to my windows PC and my multithreading is no longer running. 8 python processes spin up in task manager but they all use 0% CPU and the ParalellMonteCarlo does not return anything (it just runs eternally). This code worked fine on my MacBook and google colab so I assume it is a problem with windows.
def Sample():
return 'test'
def _paralell_mc(num_iter):
pool=mp.Pool(8)
future_res = [pool.apply_async(Sample, for _ in range(num_iter)]
res = [f.get() for f in future_res]
return res
def ParalellMonteCarlo(num_iter=100):
samples = _paralell_mc(num_iter)
return samples
(code simplified to demonstrate the problem - this does not terminate)
Thanks in advance!