Administrator
2024-02-27 64acc2bcd5e531f02be2da919e97b7af6bc86e4a
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)