Starting my script off with:
for i in range(threads): t = Thread(target=getSizes, args=(i,)) t.start() Then when one of the threads is able to get the variables needed for the other functions it does:
for i in range(threads): t = Thread(target=cart, args=(i, sizes, prod_name, product_id)) t.start() Is there any way to till all threads started on getSizes() and then start new threads on cart()?
getSizeshas a loop, it could check a semphore on each iteration. When one sets it, the others exit.threading.enumerate()and then decide if you can do something like this.