from multiprocessing import Pool
def cube(x):
return x ** 3
if __name__ == "__main__":
pool = Pool(5)
result = pool.map(cube, [0, 1, 2, 3])
Pool is a class which manages multiple Workers (processes) behind the scenes and lets you, the programmer, use.
Pool(5) creat...