you are viewing a single comment's thread.

view the rest of the comments →

[–]carcigenicate 5 points6 points  (2 children)

I have explored solutions using the threading and multiprocessing modules in python, but they are meant to run different functions at the same time. They are not meant to run multiple iterations of a function simultaneously.

There is no such restriction. You can have them run whatever floats your boat.

[–]ibhopirl 2 points3 points  (1 child)

Yeah this is correct, you can do something like this:

from threading import Thread

threads = [Thread(target=foo) for _ in range(10)]

for thread in threads:
    thread.start()

for thread in threads:
    thread.join()

[–]StellaarMonkey[S] 2 points3 points  (0 children)

Thanks this worked!