def smile_detection(thread_name):
    global count, lock
for x in range(10):
    with lock:
        counter.value += 1
print(thread_name, counter.value)
x = multiprocessing.Process(target=smile_detection, args=('Thread1',))
y = multiprocessing.Process(target=smile_detection, args=('Thread2',))
x.start()
y.start()
x.join()
y.join()
Python Multiprocessing совместное использование глобальных значений