Functional programming and concurrency

The most effective concurrent processing occurs where there are no dependencies among the tasks being performed. The biggest difficulty in developing concurrent (or parallel) programming is coordinating updates to shared resources.

When following functional design patterns, we tend to avoid stateful programs. A functional design should minimize or eliminate concurrent updates to shared objects. If we can design software where lazy, non-strict evaluation is central, we can also design software where concurrent evaluation is helpful. This can lead to embarrassingly parallel design, where most of the work can be done concurrently with few or no interactions among computations.

Dependencies among operations ...

Get Functional Python Programming - Second Edition 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.