shared list in multiprocessing python
import multiprocessing
manager = multiprocessing.Manager()
shared_list = manager.list()
def worker1(l):
l.append(1)
def worker2(l):
l.append(2)
process1 = multiprocessing.Process(
target=worker1, args=[shared_list])
process2 = multiprocessing.Process(
target=worker2, args=[shared_list])
process1.start()
process2.start()
process1.join()
process2.join()
print shared_listOutput[1, 2]