I\'ve got two separate functions. Each of them takes quite a long time to execute.
def function1(arg):
do_some_stuff_here
return result1
def function2
This is another example I just found, hope it helps, nice and easy ;)
from multiprocessing import Pool
def square(x):
return x * x
def cube(y):
return y * y * y
pool = Pool(processes=20)
result_squares = pool.map_async(square, range(10))
result_cubes = pool.map_async(cube, range(10))
print result_squares.get(timeout=3)
print result_cubes.get(timeout=3)