Using multiprocessing.Pool with a variable number of threads

后端 未结 0 503
情歌与酒
情歌与酒 2021-02-11 00:34

I find myself often writing code like the following:

from multiprocessing import Pool

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


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