title: Does multiprocessing creates a copy of a class?
body: <p>I am using multiprocessing in Python to run a number of tasks.</p>
  
  <p>I am doing it like this:</p>
  
  <pre><code>    tasks = multiprocessing.JoinableQueue()
      results = multiprocessing.Queue()      
  
      # Start consumers
  
      num_consumers = multiprocessing.cpu_count() * 2
      consumers = [ Consumer(tasks, results) for _ in range(num_consumers) ]  
  
      for w in consumers:
          w.start()
  </code></pre>
  
  <p>And then I have an attribute "Colony" which has a list of ants, all initialized in <code>__init__</code></p>
  
  <pre><code>        for ant in self.colony.ants:
              tasks.put(ant)
              num_tasks += 1
  </code></pre>
  
  <p>The thing is that when I run all the tasks (ie. The method <code>__call__</code>) is called in each ant.
  I return <code>self</code> and when I compare:</p>
  
  <pre><code>        # We wait now for all the ants to finish 
          tasks.join() 
          results_list = list()
  
          for _ in range(num_tasks):
              results_list.append(results.get())
  
          print (id(results_list[0]),results_list[0].id)
          print(id(self.colony.ants[0]),self.colony.ants[0].id)
  </code></pre>
  
  <p>And I get</p>
  
  <blockquote>
  <pre><code>(33524112, 0)
  (33005072, 0)
  </code></pre>
  </blockquote>
  
  <p>So it's the same ant, but after it's been called by the Consumer it creates a copy of itself? or am I missing something.
  The ant is not instantiated anywhere else.</p>
  
  <p>Thanks in advance</p>