Python Multiprocess not terminate
<p>I am new to python multiprocess and I want to understand why my code does not terminate (maybe zombi or deadlock) and how to fix it. The <code>createChain</code> functions execute a for loop also and returns a tuple: <code>(value1, value2)</code>. Inside <code>createChain</code> function there are other calls to other functions. I don't think posting the <code>createChain</code> function code will help because inside that function I am not doing something regarding multiprocess. I tried to make the processes as deamon but still didn't work. The strange think is that if I decrease the value of <code>maxChains</code> i.e to 500 or 100 is working. </p>

<p>I just want the process to do some heavy tasks and put the results to a data type.  </p>

<p>My version of python is 2.7</p>

<pre><code>def createTable(chainsPerCore, q, chainLength):

    for chain in xrange(chainsPerCore):
         q.put(createChain(chainLength, chain))


def initTable():
    maxChains = 1000
    chainLength = 10000
    resultsQueue = JoinableQueue()
    numOfCores = cpu_count()
    chainsPerCore = maxChains / numOfCores

    processes = [Process(target=createTable, args=(chainsPerCore, resultsQueue, chainLength,)) for x in range(numOfCores)]

    for p in processes:
        # p.daemon = True
        p.start()

    # Wait for hashing cores to finish
    for p in processes:
        p.join()

    resultsQueue.task_done()

    temp = [resultsQueue.get() for p in processes]
    print temp
</code></pre>