title: Can't pickle <type 'instancemethod'> using python's multiprocessing Pool.apply_async()
body: <p>I want to run something like this: </p>
  
  <pre><code>from multiprocessing  import Pool
  import time
  import random
  
  class Controler(object):
      def __init__(self):
          nProcess = 10
          pages = 10
          self.__result = []
          self.manageWork(nProcess,pages)
  
  def BarcodeSearcher(x):
      return x*x
  
  def resultCollector(self,result):
      self.__result.append(result)
  
  def manageWork(self,nProcess,pages):
      pool = Pool(processes=nProcess)
      for pag in range(pages):
          pool.apply_async(self.BarcodeSearcher, args = (pag, ), callback = self.resultCollector)
  
      print self.__result
  
  if __name__ == '__main__':
      Controler()
  </code></pre>
  
  <p>but the code result the error :</p>
  
  <pre><code>   Exception in thread Thread-1:
  Traceback (most recent call last):
    File "C:\Python26\lib\threading.py", line 522, in __bootstrap_inner
      self.run()
    File "C:\Python26\lib\threading.py", line 477, in run
      self.__target(*self.__args, **self.__kwargs)
    File "C:\python26\lib\multiprocessing\pool.py", line 225, in _handle_tasks
      put(task)
  PicklingError: Can't pickle &lt;type 'instancemethod'&gt;: attribute lookup __builtin__.instancemethod failed
  </code></pre>
  
  <p>I've seen the posts (<a href="https://stackoverflow.com/questions/1816958/cant-pickle-type-instancemethod-when-using-pythons-multiprocessing-pool-ma/1816969#1816969">post1</a> , <a href="https://stackoverflow.com/questions/3288595/multiprocessing-using-pool-map-on-a-function-defined-in-a-class">post2</a>) to solve my problem. I'm looking for something like Mike McKerns solution in the second post but without using pathos.  </p>