[Tutor] multiprocessing with more than two arguments
m.kossner at tu-bs.de
Thu Oct 15 20:04:15 CEST 2009
let's simply start with an example:
import numpy as n
from multiprocessing import Pool
p = Pool(processes=2)
This code works qite fine, as long as i yust want to map the
calculate function onto a list of values of a (the first argument of the
function). But what if I want to change the value of b in the compute
function to some other value, than the default one?
I tested things like result=p.map(calculate,a_list,b=5) or
result=p.map(calculate,args=(a_list,b=5)) but nothing works?
Thanks in advance for any help!
More information about the Tutor