In this chapter, we will bring together several themes from earlier chapters. In particular, we will weave together the functional programming concepts from previous chapters with the Java concurrency libraries from chapter 6. Our non-Java languages get included as well, with some novel concurrency aspects of both Kotlin and Clojure appearing later in the chapter.
Note
We’ll kick off with a slight oddity: the Java Fork/Join API. This framework allows a certain class of concurrent problems to be handled more efficiently than the executors we saw in chapter 6.
As we discussed in chapter 7, processor speeds (or, more properly, transistor counts on CPUs) have increased hugely in recent years. I/O performance has not had the same remarkable improvement, and so the end result is that waiting for I/O is now a common situation. This suggests that we could make better use of the processing capabilities inside our computers. The Fork/Join (F/J) framework is an attempt to do just that.