I have code where already loop is used and I want to replace loop with multithreading, but not able to understand how to do. below is code.
def run_test_function(arg1,arg2, arg3, arg4, arg5):
try:
#loop1
for x in arg1:
#loop2
for y in arg2:
#loop3
for z in range(len(arg3)):
#statements
#statements
#statements
except Exception as e:
print(e)
def main(argv):
arg1 = value1
arg2 = value2
arg3 = value3
arg4 = value4
run_test_function(arg1, arg2, arg3, arg4)
I want every iteration of loop1 should behave as a thread, so that I can replace loop with multithreading. Appreciation and thanks in advance for help. :)