for i in range(n):
    d = dict(i=i)
p = mp.Process(target=count, kwargs=d)
p.start()
c.append(p)
for p in reversed(c):
    p.join()
print('joined')

def count(i):
    print('{i} going to sleep'.format(i=i))
time.sleep(i * 10)
print('{i} woke up'.format(i=i))
if __name__ == '__main__':
    main()
how to kill zombie processes created by multiprocessing module?