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)
上一篇

2023-05-10