I used python(2.7) module multiprocessing, to implement parallel processing in one of my scripts.
import sys
import multiprocessing
def myfun(file):
try:
<my logic>
except Exception:
sys.exit(-1)
my_file_list ['file1', 'file2', 'file3', 'file4', 'file5', 'file6', 'file7', 'file8', 'file9', 'file10', 'file11', ]
pool = multiprocessing.Pool(processes=3)
pool.map(myfun, my_file_list )
Whenever my function myfun error out because of some file anomalies, my main function will go into a infinite wait! and I wi;; have to kill it. Can someone help me to fix my code/logic?