Administrator
2024-01-19 a00da3062c6c825b585f82275823ac45cdeb6502
test/test_threadpool.py
@@ -66,4 +66,13 @@
if __name__ == '__main__':
    thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=20)
    thread_pool.submit(lambda: test1("123123"))
    input()
    thread_pool.submit(lambda: test1("123123"))
    thread_pool.submit(lambda: test1("123123"))
    thread_pool.submit(lambda: test1("123123"))
    while True:
        running_count = 0
        for future in thread_pool._threads:
            if future.is_alive():
                running_count += 1
        print(running_count)
        time.sleep(1)