from multiprocessing import Pool
pool = Pool(processes=10)
lstm_y = 0
combine_y = 1
def work_callback1(res):
print('work1')
global lstm_y
global combine_y
lstm_y += res
combine_y += res
def run1():
return 1
if __name__ == '__main__':
for i in range(1,10):
res1 = pool.apply_async(run1, (i,),callback=work_callback1)
print(lstm_y,combine_y)
the code above is not work! I will update it later!