Python, Programming, Coding, Software Development, Datastrucutre.
__name__ == '__main__': num = Value('i', 0) # create a shared integer with initial value of 0 p1 = Process(target=increment, args=(num,)) p2 = Process(target=increment, args=(num,)) p1.start() p2.start() p1.join() p2.join() print(num.value) Since the num value is shared among two processes if you