以下のコードは Unix では完全に動作しますが、Windows 7 では multiprocessing.TimeoutError を生成します (どちらの OS も python 2.7 を使用します)。
理由はありますか?ありがとう。
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)