title: python multiprocessing, make instance per process and reuse it
body: <p>I'm using pytesseract to do some ocr with a multiprocessing approach.</p>
  
  <p>The approach looks the following:</p>
  
  <pre><code>tess_api = PyTessBaseAPI()
  Parallel(n_jobs=4)(delayed(execute)(image) for image in images)
  </code></pre>
  
  <p>having the function:</p>
  
  <pre><code>def execute(image):
      tess_api.SetImage(image)
      text = tess_api.GetUTF8Text()
  </code></pre>
  
  <p>this will lead into a concurrency problem as Worker 1 could override the image before Worker 2 is executing gettext()</p>
  
  <p>The idea is now to have per worker one instance of <code>PyTessBaseAPI</code>.
  The main idea would be to do something like:</p>
  
  <pre><code>tess_apis = [PyTessBaseAPI(), PyTessBaseAPI(), PyTessBaseAPI(), PyTessBaseAPI()]
  </code></pre>
  
  <p>and then hand over <code>tess_api[0]</code> to the worker 0 but I don't know how I could do the connection between the worker and the instance.
  Any suggestions, or what would be a better approach?
  As I have thousands of images I don't wan't to create instances inside the execute function.</p>