# 关于 Python 中的 threadpool

2019-11-26 14:43:25 +08:00
 18870715400
import threadpool
pool = threadpool.ThreadPool(10)
def fun(s):
    print(s)
while 1:
    params = create_num()
    requests = threadpool.makeRequests(fun, params)
    [pool.putRequest(req) for req in requests]
    pool.wait()

想问一下大神,create_num 函数是一个随机产生长度 1 到 10 的列表, 我想请问一下除了 create_num 函数 有没有其它方法来监控 pool 中运行的线程的个数

2253 次点击
所在节点    Python
2 条回复
keakon
2019-11-26 15:22:52 +08:00
第三方的库就别想着用它接口以外的东西了
Harlaus
2019-11-27 15:46:33 +08:00
没听懂你想干嘛

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/623276

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX