I have a numerical function in python (based on scipy.optimize.minimize)
def func(x):
   //calculation, returning 0 if done
and an algorithm as follows:
for x in X:
    run func(x) 
    terminate the loop if  one of func(x) returns 0 
Above, X is a large set of doubles, each func(x) is independent from the other.
Question: Which of Python's multi-threading/multi-processing functionality can I use to maximize the performance of this calculation?
For info, I am using a multi-core computer.
 
    