Wrap-Up

There’s a common misconception about parallelism—many people believe that parallel programming necessarily raises the specter of nondeterminism. If things aren’t proceeding sequentially, the reasoning goes, and we can no longer rely on effects happening in a specific order, we’re always going to have to worry about race conditions.

Certainly, there are some concurrent programs that will always be nondeterministic. And this is unavoidable—some problems require solutions that are intrinsically dependent on the details of timing. But it’s not the case that all parallel programs are necessarily nondeterministic. The value of the sum of the numbers between 0 and 10,000 won’t change just because we add those numbers together ...

Get Seven Concurrency Models in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.