Is there a simple way of making a process terminate if its alive status remains TRUE for a given timeout?
I am using Python multiprocessing module to launch processes in several cores. Sometimes those processes do not succeed and get stuck without doing anything, but with an alive status (is_alive()=TRUE).
jobs = [] # this list will contain all jobs
for i in studies: # we will call as many processes as elements in studies
arguments = (i) # my arguments
p = multiprocessing.Process(target = myprocess, args = arguments)
jobs.append(p) # list of jobs
p.start() # start process
I am looking for something that substitutes p.start() with something like:
p.start_with_timeout(t=mytime)
Thanks!