title: Why can I pass an instance method to multiprocessing.Process, but not a multiprocessing.Pool?
body: <p>I am trying to write an application that applies a function concurrently with a <code>multiprocessing.Pool</code>. I would like this function to be an instance method (so I can define it differently in different subclasses). This doesn't seem to be possible; as I have learned elsewhere, apparently <a href="https://stackoverflow.com/questions/1816958/cant-pickle-type-instancemethod-when-using-pythons-multiprocessing-pool-ma">bound methods can't be pickled</a>. So why does starting a <code>multiprocessing.Process</code> with a bound method as a target work? The following code:</p>
  
  <pre><code>import multiprocessing
  
  def test1():
      print "Hello, world 1"
  
  def increment(x):
      return x + 1
  
  class testClass():
      def process(self):
          process1 = multiprocessing.Process(target=test1)
          process1.start()
          process1.join()
          process2 = multiprocessing.Process(target=self.test2)
          process2.start()
          process2.join()
  
      def pool(self):
          pool = multiprocessing.Pool(1)
          for answer in pool.imap(increment, range(10)):
              print answer
          print
          for answer in pool.imap(self.square, range(10)):
              print answer
  
      def test2(self):
          print "Hello, world 2"
  
      def square(self, x):
          return x * x
  
  def main():
      c = testClass()
      c.process()
      c.pool()
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>Produces this output:</p>
  
  <pre><code>Hello, world 1
  Hello, world 2
  1
  2
  3
  4
  5
  6
  7
  8
  9
  10
  
  Exception in thread Thread-2:
  Traceback (most recent call last):
    File "C:\Python27\Lib\threading.py", line 551, in __bootstrap_inner
      self.run()
    File "C:\Python27\Lib\threading.py", line 504, in run
      self.__target(*self.__args, **self.__kwargs)
    File "C:\Python27\Lib\multiprocessing\pool.py", line 319, in _handle_tasks
      put(task)
  PicklingError: Can't pickle &lt;type 'instancemethod'&gt;: attribute lookup __builtin__.instancemethod failed
  </code></pre>
  
  <p>Why can Processes handle bound methods, but not Pools?</p>