I am trying to use multiprocessing, but sometime the Pool.apply_async() will call the method, sometime not execute the method. And there is no any error log. My code like this:
p = Pool(6)
for i in range(2):
for j in range(2):
algo_one= p.apply_async(Algo_one.algorithm_run, error_callback=error_callback_log)
algo_two= p.apply_async(Algo_two.algorithm_run, error_callback=error_callback_log)
algo_three= p.apply_async(Algo_three.algorithm_run, error_callback=error_callback_log)
algo_four= p.apply_async(Algo_four.algorithm_run, error_callback=error_callback_log)
algo_five= p.apply_async(Algo_five.algorithm_run, error_callback=error_callback_log)
algo_six= p.apply_async(Algo_six.algorithm_run, error_callback=error_callback_log)
result_one = algo_one.get()
result_two = algo_two.get()
result_three = algo_three.get()
result_four = algo_four.get()
result_five = algo_five.get()
result_six = algo_six.get()
p.close()
p.join()
Why that? I’m using Python 3.12 on Ubuntu 22.04.
Thank you for any hint!