https://app.dataquest.io/c/107/m/565/introductions-to-parallel-processing/8/sharing-memory-caveats

This problem asks us use parallel processing to add all values between 1 and 10,000 exclusive.

The lesson states the code used is actually unpredictable, with one instance returning 38769868 instead of the answer, 49995000.

Upon running the correct answer:

```
def sum_values(first, last, shared_value):
for i in range(first, last):
shared_value.value += i
def sum_with_two_processes():
N = 10000
shared_value = multiprocessing.Value("i")
process1 = multiprocessing.Process(target=sum_values, args=(1, N // 2, shared_value))
process2 = multiprocessing.Process(target=sum_values, args=(N // 2, N, shared_value))
process1.start()
process2.start()
process1.join()
process2.join()
return shared_value.value
# Add code below
results = []
for _ in range(10):
result = sum_with_two_processes()
results.append(result)
print(results)
```

I get this output:

```
[49995000, 49995000, 49995000, 49995000, 49995000, 49995000, 49995000, 49995000, 49995000, 49995000]
```

Which is the correct answer for all 10 iterations.

I thought this method was unpredictable?