December 2021
Beginner
840 pages
47h 29m
English
As we conclude this chapter, we leave readers with a thought to ponder. We know from the study of operating systems that when two or more concurrent threads share a resource, we must synchronize their activities to ensure that the integrity of the resource is maintained and the system is never left in an inconsistent state— we must synchronize to avoid data races. Therefore, in the absence of side effects and, thus, any shared state and/or mutable data, functional programs are natural candidates for parallelization:
You can’t change the state of anything, and no function can have side effects, which is the reason why [functional programming] is ideal for distributing algorithms over multiple cores. You never have to worry about ...