black11black
V2EX  ›  问与答

Python 线程池,有没有什么办法能确认到当前线程池中线程数量?

  •  
  •   black11black · Dec 27, 2020 · 1378 views
    This topic created in 1992 days ago, the information mentioned may be changed or developed.

    如题,想要进行一些压力测试,想获取一下线程池数量,文档里没看到方法,有人知道吗?

    就是以下的这个包

    from concurrent.futures import ThreadPoolExecutor
    
    thread_pool = ThreadPoolExecutor()
    

    我知道这个线程池在创建时可以限制最大线程数量。

    但若不限制的话,我想尝试最大能达到多少,以及在多少的时候比较稳定。

    谢谢

    1 replies    2020-12-27 14:01:48 +08:00
    111111111111
        1
    111111111111  
       Dec 27, 2020   ❤️ 1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5441 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 07:52 · PVG 15:52 · LAX 00:52 · JFK 03:52
    ♥ Do have faith in what you're doing.