会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
帅胡
2023年5月14日
ThreadPoolExecutor的使用
摘要: 线程池的基类是 concurrent.futures 模块中的 Executor,Executor 提供了两个子类,即 ThreadPoolExecutor 和 ProcessPoolExecutor,其中 ThreadPoolExecutor 用于创建线程池,而 ProcessPoolExecut
阅读全文
posted @ 2023-05-14 22:11 帅胡
阅读(314)
评论(0)
推荐(0)
ThreadPoolExecutor获取线程池中已经运行完的任务结果
摘要: 方法一: 使用as_completed函数 from concurrent.futures import ThreadPoolExecutor, as_completed from time import sleep def method(times): sleep(times) print('sl
阅读全文
posted @ 2023-05-14 21:13 帅胡
阅读(1176)
评论(0)
推荐(0)
导航
博客园
首页
新随笔
联系
订阅
管理
公告