15

Concurrency

Concurrency in functional programs is substantially less complicated than it is in programs that support mutable state. The reason, as I said back in Chapter 1, is that you can’t have concurrent update problems if you don’t do updates. I also said that this means you can’t have race conditions.

These “facts” remove much of the complication of dealing with multiple threads. Threads simply cannot interfere with one another if they are composed of pure functions.

Or can they?

While comforting, those “facts” are not precisely true. The purpose of this chapter is to show how multithreaded “functional” programs can still have race ...

Get Functional Design: Principles, Patterns, and Practices 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.