Why are the children failing to die? Why are the children failing to die? linux linux

Why are the children failing to die?


Because terminate function just send SIGTERM signal to process, but signals are asynchronous, so you can sleep for some time, or wait for processes termination(signal receiving).

For example if you add string time.sleep(.1) after termination, it probably will be terminated.