Using multiprocessing.Pool with a variable number of threads

后端 未结 0 1856
囚心锁ツ
囚心锁ツ 2021-02-11 00:33

I find myself often writing code like the following:

from multiprocessing import Pool

def foo(data, threads=4):
    if threads > 1:
        pool = Pool(thread         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题