title: Parallel execution of class methods
body: <p>I need to execute in parallel a method of many instances of the same class. For doing this I'm trying to use the <a href="https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#multiprocessing.Process.start" rel="noreferrer"><code>Process.start()</code></a> and the <a href="https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#multiprocessing.Process.join" rel="noreferrer"><code>Process.join()</code></a> commands from the <a href="https://docs.python.org/3.4/library/multiprocessing.html?highlight=process#module-multiprocessing" rel="noreferrer"><code>multiprocessing</code></a> module.</p>
  
  <p>For example for a class:</p>
  
  <pre><code>class test:
       def __init__(self):
       ...
       ...
       def method(self):
       ...
       ...
  </code></pre>
  
  <p>where <code>method</code> modifies some of the class variables. If I make two instances of the class:</p>
  
  <pre><code>t1=test()
  t2=test()
  </code></pre>
  
  <p>And execute:</p>
  
  <pre><code>from multiprocessing import Process
  pr1=Process(target=t1.method, args=(,))
  pr2=Process(target=t2.method, args=(,))
  pr1.start()
  pr2.start()
  pr1.join()
  pr2.join()
  </code></pre>
  
  <p>the variables of the instances of the class are not updated (the whole code is too long to be pasted here but this is the idea).</p>
  
  <p>Is there any way to achieve this?
  Thank you</p>