0

i have a program which uses the multiprocessing library to spawn processes that do some heavy computations differently and return the results which i have tried collecting using a queue the problem is that the processes start but the queue runs forever and i have to end it myself. what could be the cause of this. An example is

from multiprocessing import Process, Queue
from postman import scion

def rez(vix):
    vix += 1

if __name__ == '__main__':
    #some preliminary computations gets done here
    qout = Queue()
    proc = [Process(target=scion, args=(v, basket, qout)) for v in state]

    for p in proc:
        p.start()

    for p in proc:
        comcon = qout.get()
        rez(comcon)

    for p in proc:
        p.join()

1 Answers1

0

I later found out that this is a Windows issue and the fact that spyder uses a live interpreter. The solution was to run the program from command prompt of which it performed flawlessly. This post was the one that helped me get this insights, just in case anyone runs into the same problem. stackoverflow post