from concurrent.futures import ThreadPoolExecutor thread_pool = ThreadPoolExecutor(max_workers=10) # 最大worker数量为10,当线程数超过10之后,后面填进去的都会等待,直到线程池有空闲 def func(params): pass thread_pool.submit(func,params) # params是func的参数