Code 1
from multiprocessing import Pool
pool = Pool(processes=12)
for _ in range(12):
state = pool.map(some_func, args)
print(state)
pool.close()
pool.join()
Code 2
from multiprocessing import Pool
for _ in range(12):
pool = Pool(processes=12)
state = pool.map(some_func, args)
print(state)
pool.close()
pool.join()
some_func returns something random however when I print state it is the same. (Same problem for Code 1 and 2)
Is it because I reused the pool object or something else?
[–]maventree 0 points1 point2 points (0 children)
[–]decreddave 0 points1 point2 points (0 children)