Closed as not planned
Closed as not planned
Description
Dear all,
I am developing a data library that uses multiprocessing internally.
https://github.com/antoinecarme/pyaf
The code based on this library works flawlessly on linux, but some users, including myself, cannot execute it on Windows (with different versions of python : 3.8, 3.9, 3.10).
This seems to be a general buggy pattern. A function that uses mutliprocessing cannot be called from another function.
I reduced the code to get something that demonstrates this issue, the code below works on debian but not on windows (python 3.10, downloaded yesterday from python website and installed on windows 10)
from multiprocessing import Pool
def f(x):
return x*x
def g(K, N):
# Any external function that uses multiprocessing can be used here.
with Pool(K) as p:
x = p.map(f, [x for x in range(N)])
return x
# mix of different multiprocessing tasks.
# expected output : [0, 1, 0, 1, 4]
print(g(3,2) + g(2, 3))
The expected output is copy-pasted from debian. this is a very blocking issue for Windows users.
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done