I have a function in python which I need to execute it multiple times and at the same time (to save computational cost). The following is a simple example and I don't know how to call my function at the same time!
def f(x):
return x
y1=f(x1)
y2=f(x2)
I need to execute y1 and y2 at the same time and wait until both finish and save the results. Thank you all in advance.