Python, Programming, Coding, Software Development, Datastrucutre.
for i in range(1000): n[i % 10] += 1 if __name__ == '__main__': num = Array('i', [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) # create a shared array of 10 integers p1 = Process(target=increment, args=(num,)) p2 = Process(target=increment, args=(num,)) p1.start() p2.start() p1.join() p2.join() print(num[:])