19 An introduction to message-passing concurrency
This chapter covers
- Why shared mutable state is sometimes required
- Understanding message-passing concurrency
- Programming with agents in C#
- Hiding agent-based implementations behind conventional APIs
Every seasoned developer has some first-hand experience of how difficult it can be to deal with problems such as deadlocks and race conditions. These are the hard problems that can arise in concurrent programs that involve shared mutable state (“shared,” that is, between processes that execute concurrently).
This is why, throughout this book, you’ve seen many examples of how to solve problems without making recourse to shared mutable state. Indeed, my recommendation is to avoid shared mutable state ...
Get Functional Programming in C#, 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.