特牛网址导航

进程池和线程池-CSDN博客

网友收藏
1.同步执行--------------from concurrent.futures import ProcessPoolExecutor,ThreadPoolExecutorimport os,time,randomdef task(n): print('[%s] is running'%os.getpid()) time.sleep(random.randi..._进程池是主程序结束就自动结束,map是自带close方法和join方法 (执行(进程或线程)