December 2022
Intermediate to advanced
528 pages
15h 41m
English
Chapter 26 advocates the functional use of futures in a programming style that minimizes thread blocking. Over the years, much effort has been spent trying to avoid unnecessary thread blocking, often for performance reasons.1 This chapter provides a quick overview of some popular techniques that strive not to block threads and often abstain from using locks and other synchronizers.
1This process is still ongoing. On the JVM, in particular, see https://openjdk.org/jeps/425, known as Project Loom.
As a first illustration, consider the case of class java.util.concurrent.AtomicInteger, used in some earlier examples. It is straightforward to implement a thread-safe mutable integer in Java ...
Read now
Unlock full access