The resource loading... loading...

Can't use the process pool in python?

Author: lonelyman, Created: 2018-04-13 10:21:31, Updated: 2018-04-13 10:24:47

def add(args): (x,y) = args return x+y

def main(): if __name__ == “__main__”: pool = Pool(2) results = pool.map(add,[(1,2),(2,3),(3,4)]) Log(“result”,results)

This code always suggests that you can't pickle to add methods, can anyone help me look it up? or provide a bit of a run-through process pool example.


More