【发布时间】:2016-06-10 05:08:03
【问题描述】:
我需要在 python 中运行两个连续的 pool.maps。但第二个取决于第一张地图的结果。因此,在运行第二个 pool.map 之前,我需要确保对所有参数执行 function1。谁能告诉我怎么做?
# The first multiprocessing unit
pool = Pool(processes=num_p)
new_args=dict(pool.map(function1, args))
# The second multiprocessing unit
pool.map(function2, new_args)
谢谢
【问题讨论】:
标签: python-3.x threadpool python-multiprocessing