gpt4 book ai didi

python - 如何一次运行最多 10 个线程?

转载 作者:太空宇宙 更新时间:2023-11-03 12:16:13 25 4
gpt4 key购买 nike

我想向单个服务器发出 1000 个请求。

我使用线程模块,但服务器阻止了我。

如何设置一次最多只运行10个线程的线程(形成一个1000个的列表)?

最佳答案

使用线程池。有一个 thread pooling example在 Doug Hellman 的精彩 threading article .

关于python - 如何一次运行最多 10 个线程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19620029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com