count = multiprocessing.Value(ctypes.c_int, 0)

def smile_detection(thread_name, count):
    for x in range(10):
        count.value += 1
print(thread_name, count)
return count
x = multiprocessing.Process(target=smile_detection, args=('Thread1', count))
y = multiprocessing.Process(target=smile_detection, args=('Thread2', count))
x.start()
y.start()
Python Multiprocessing sharing of global values