Day 3: Functional Concurrency
Over the previous two days, weâve concentrated on parallelism. Today weâre going to change focus and look at concurrency. But before we do so, weâll look deeper into why functional programming allows us to parallelize code so easily.
Same Structure, Different Evaluation Order
A common theme runs through everything weâve seen over the last couple of daysâfunctional programming allows us to play games with the order in which things are evaluated. If two calculations are independent, we can run them in any order we like, including in parallel.
The following code snippets all perform the same calculation, return the same result, and have almost identical structure, but they execute their component operations ...
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.