I’ve encounter the same problem myself, I’ve got the following solution:
before calling p.start()
, you may set p.daemon=True
. Then as mentioned here python.org multiprocessing
When a process exits, it attempts to terminate all of its daemonic child processes.