首页 > 解决方案 > 我需要等待 ThreadPoolExecutor 完成吗?

问题描述

我正在使用 aconcurrent.futures.ThreadPoolExecutor来保存一堆缓存文件:

with concurrent.futures.ThreadPoolExecutor() as e:
    e.map(save, cache)

在从函数返回之前我是否需要“等待”它?还是会在后台自行完成?

标签: pythonpython-3.xpython-3.9

解决方案


推荐阅读