pool = multiprocessing.Pool(processes=multiprocessing.cpu_count())
test_list = [1, 2, 3, 4]
for number in test_list:
pool.apply_async(func=test_quit, args=[number, ])
pool.close()
pool.join()
when i call os._exit(), the program terminate successfully
def test_quit(number):
if number == 1:
print("1 should exit")
os._exit()
but when i use os._exit(1), the program is still working.
def test_quit(number):
if number == 1:
print("1 should exit")
os._exit(1)
so whats the difference of this two func, why os._exit(1) can not stop the program