title: How do you pass a manager variable and another variable to target function in multiprocessing?
body: <p>I would like to pass 2 manager dictionaries along with another variable to a target function in multiprocessing:</p>
  <pre><code>import multiprocessing as mp
  def f(x, d1, d2):
      d1[x] =  2*x
      d2[x] =  x*x
      
  
  if __name__ == '__main__':
      x = [1, 2, 3, 4]
  
      manager = mp.Manager()
      d1 = manager.dict() 
      d2 = manager.dict()
  
      MAX_PROCESSES = 4
      pool = mp.Pool(MAX_PROCESSES)
      pool.map(f, (x, d1, d2))
  </code></pre>
  <p>In so doing, I would like <code>process[i]</code> to get <code>x[i]</code>, and all 4 processes to share the dictionaries <code>d1</code> and <code>d2</code>.</p>
  <p>However I get the following error:</p>
  <blockquote>
  <p>TypeError: f() missing 2 required positional arguments: 'd1' and 'd2'</p>
  </blockquote>