Administrator
2023-09-14 165042052bbc089787eba9fb71f72659135a34e9
test/test_threadpool.py
@@ -58,12 +58,12 @@
        time.sleep(2)
if __name__ == '__main__':
    p1, p2 = multiprocessing.Pipe()
    serverProcess = multiprocessing.Process(target=run_process_1, args=(p1,))
    jueJinProcess = multiprocessing.Process(target=run_process_2, args=(p2,))
    serverProcess.start()
    jueJinProcess.start()
def test1(params):
    time.sleep(1)
    print("执行结束", params)
    while True:
        time.sleep(2)
if __name__ == '__main__':
    thread_pool = concurrent.futures.ThreadPoolExecutor(max_workers=20)
    thread_pool.submit(lambda: test1("123123"))
    input()