Multiprocessing pool 'apply_async' only seems to call function once
问题 I've been following the docs to try to understand multiprocessing pools. I came up with this: import time from multiprocessing import Pool def f(a): print 'f(' + str(a) + ')' return True t = time.time() pool = Pool(processes=10) result = pool.apply_async(f, (1,)) print result.get() pool.close() print ' [i] Time elapsed ' + str(time.time() - t) I'm trying to use 10 processes to evaluate the function f(a) . I've put a print statement in f . This is the output I'm getting: $ python pooltest.py f