21
I have a scenario like this :
for each in content :
pdf_output,job_id=createpdf(each)
if pdf_output :
pdf_output = pdf_output + pdf_output
I am trying to parallelize the whole process .Something like this
jobs=[]
for each in content :
jobs.append(multiprocessing.Process(target=self.createpdf, args=(content)))
for each in jobs :
jobs.start()
for each in jobs :
jobs.join()
How do I sensibly do the task of
if pdf_output :
pdf_output = pdf_output + pdf_output
For each job ? How do I retrieve the 2 retun values sent by createpdf and work on it ? I think multiprocessing.Queue is a clue , but how do I implement this ?