y = Value('i', 0)
for i in range(5):
    Process(target=foo, args=(x, 'x')).start()
Process(target=foo, args=(y, 'y')).start()
print('Before waiting: ')
print('x = {0}'.format(x.value))
print('y = {0}'.format(y.value))
time.sleep(5.0)
print('After waiting: ')
print('x = {0}'.format(x.value))
print('y = {0}'.format(y.value))
Shared variable in python's multiprocessing