Python - Multiprocessing pool.map(): Processes don't do anything
<p>I am trying to use the python multiprocessing library in order to parallize a task I am working on:</p>

<pre><code>import multiprocessing as MP

def myFunction((x,y,z)):
    ...create a sqlite3 database specific to x,y,z
    ...write to the database (one DB per process)

y = 'somestring'
z = &lt;large read-only global dictionary to be shared&gt;

jobs = []
for x in X:
    jobs.append((x,y,z,))

pool = MP.Pool(processes=16)
pool.map(myFunction,jobs)
pool.close()
pool.join()
</code></pre>

<p>Sixteen processes are started as seen in <code>htop</code>, however no errors are returned, no files written, no CPU is used.</p>

<p>Could it happen that there is an error in myFunction that is not reported to STDOUT and blocks execution?</p>

<p>Perhaps it is relevant that the python script is called from a bash script running in background.</p>

<p>The lesson learned here was to follow the strategy suggested in one of the comments and use <code>multiprocessing.dummy</code> until everything works.</p>

<p>At least in my case, errors were not visible otherwise and the processes were still running as if nothing had happened.</p>

python dictionary parallel-processing multiprocessing pool