Summary
We have explored various constructs that can be used to create concurrent and parallel tasks in Clojure. You learned to handle shared mutable state through the use of reference types, namely vars, refs, atoms and agents. As we described earlier, the dining philosophers problem can be easily implemented using refs and agents. You also studied how tasks can be executed in parallel. Lastly, we explored the claypoole
library, which allows us to control the amount of parallelism used for a given computation.
In the next chapter, we will continue our exploration of parallelism in Clojure through the use of reducers.