The code below works perfectly on Unix but generates a multiprocessing.TimeoutError on Windows 7 (both OS use python 2.7).
Any idea why? Thanks.
from multiprocessing import Pool
def increment(x):
return x + 1
def decrement(x):
return x - 1
pool = Pool(processes=2)
res1 = pool.map_async(increment, range(10))
res2 = pool.map_async(decrement, range(10))
print res1.get(timeout=1)
print res2.get(timeout=1)