python concurrent.futures 获取结果变慢

python concurrent.futures getting result slows down

当我尝试获取结果时,感觉它又回到了没有被线程化的状态,但是当我没有获取结果时。它像有 10 个线程一样工作,知道为什么或如何解决这个问题吗?

pool = ThreadPoolExecutor(max_workers=10)
    info = pool.submit(check, "Username").result().result
    print(info)

Future.result() 阻塞直到结果可用。如果要多个任务同时运行,需要全部提交,然后等待结果。

pool = ThreadPoolExecutor(max_workers=10)

# Submit tasks
future1 = pool.submit(...)
future2 = pool.submit(...)

# Get task results
result1 = future1.result()
result2 = future2.result()