python-线程池


from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED

pool = ThreadPoolExecutor(max_workers=30)
tasks = [pool.submit(the_function, params) for the_task in all_tasks]

# 阻塞等待所有任务执行完
wait(tasks, return_when=ALL_COMPLETED)

文章作者: 钱不寒
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 钱不寒 !
  目录