What's the correct way to join threads in multiprocessing, so the main program waits the completion of all threads before going ahead?
I have seen these 2 ways while researching, not sure how they differ especially the first one as the second one seems more common:
for i in range(100):
j = Process(target=somefunc,args=(i,))
j.start()
j.join()
And
jobs = []
for i in range(100):
j = Process(target=somefunc,args=(i,))
jobs.append(j)
j.start()
for j in jobs:
j.join()
I am on Python 2.6.6 due to limitations on the server.