title: Python how to do multiprocessing inside of a class?
body: <p>I have a code structure that looks like this:</p>
  
  <pre><code>Class A:
    def __init__(self):
      processes = []
      for i in range(1000):
        p = Process(target=self.RunProcess, args=i)
        processes.append[p]
  
      # Start all processes
      [x.start() for x in processes]
  
    def RunProcess(self, i):
      do something with i...
  </code></pre>
  
  <p>Main script:</p>
  
  <pre><code>myA = A()
  </code></pre>
  
  <p>I can't seem to get this to run. I get a runtime error "<strong>An attempt has been made to start a new process before the
          current process has finished its bootstrapping phase.</strong>"</p>
  
  <p>How do I get multiple processing working for this? If I use Threading, it works fine but it is as slow as sequential... And I'm also afraid that multiple processing will also be slow because it takes longer for the the process to be created?</p>
  
  <p>Any good tips? Many thanks in advance.</p>