Python Multiprocessing - Wait until one process finish its job

Viewed 461

I'm writing a program to do the same task with multiple processes. So when one process finish its job, how can I stop all others to print the result?

procs = []
for _ in range(8):
        process = multiprocessing.Process(target=calculateThing)
        procs.append(process)
        process.start()

Yes I know that I can use

for process in procs:
    process.join()

But if for example process 4 will finish its job, I can't know that until processes 1,2,3 finish their jobs.

0 Answers
Related