This 2.7 Python script on MacOSx does not close Python processes. After script
runs there are 8 dormant such processes. How can I close them at end of script?
*.terminate
didn't work.
import multiprocessing
newlist = range(1,30)
ULs = [row for row in newlist]
print ULs
def ULtask(ul):
print 1234
def start_process():
print 'Start', multiprocessing.current_process().name
p_size = multiprocessing.cpu_count() * 2
pool = multiprocessing.Pool(processes=p_size, initializer=start_process, maxtasksperchild=400,)
pool_outputs= pool.map(ULtask, ULs)
pool.close() # no more tasks
pool.join() # wrap up current tasks
# pool.terminate()
print 'Pool :', pool_outputs
del pool
print "Finished UL"