title: Multiprocessing in a class and use it's instance in another class
body: <p>I am stuck in using the multiprocessing module of Python. I wanted to create multiprocessing workers in a class and use the object of this class as a composite in another class. Below is the dummy code where the structure looks the same as my original code.</p>
  <p><strong>a.py</strong></p>
  <pre><code>import concurrent.futures 
  class A:
     def __init__(self, basic_input):
         self.initial = basic_input
  
     def _worker(self, work):
        print(f&quot;Doing some {work} using {self.initial}&quot;)
  
     def print_my_work(self, set_of_works):
        with concurrent.futures.ProcessPoolExecutor(max_workers=5) as executor:
            executor.map(self._worker, set_of_works)
  </code></pre>
  <p><strong>b.py</strong></p>
  <pre><code>class B:
     def __init__(self, basic_input):
        # A is a composite object 
        self.a = A(basic_input)
    
     def get_all_works(self):
        return {'A', 'B', 'C'}
     
     def processingB(self):
        works = self.get_all_works()
        self.a.print_my_work(works)
  
  </code></pre>
  <p>Here I'm trying to use class B in another module as below</p>
  <p><strong>check.py</strong></p>
  <pre><code>import b
  obj = B('Test')
  obj.processingB()
  </code></pre>
  <p><strong>Getting below error</strong>
  Python multiprocessing RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.......</p>
  <p>Can somebody help me. Thank you for reading this question.</p>