python多进程,并获取每个进程的返回值

pool = multiprocessing.Pool(processes=10)
row = [...]
for row in rows:
    task_id = row[1]
    img_id = row[0]
    pool.apply_async(check_picture_contain_human_or_dog, (task_id, img_id))
pool.close()
pool.join()

  

posted on 2018-10-14 13:09  小唐师叔  阅读(14963)  评论(2编辑  收藏  举报