python - Does a process always need to be terminated? -


i using python process run 1 of functions so:

process1 = process(target = somefunction) process1.start() 

now function has no looping or anything, thing, ends, process die it? or need drop a:

process1.terminate() 

afterwards?

no, as per documentation sends sigterm or terminateprocess() process in question. if has exited there nothing terminate.

however, process use exit codes in subprocesses:

import sys sys.exit(1) 

and check exit code once know process has terminated:

if process1.exitcode():    errorhandle() 

Comments