I’ve recently discovered a “gotcha!” in the really useful standard Java class ThreadPoolExecutor. I think that this deserves a post, since it’s quite interesting and non obvious. Executors Executor and ExecutorService are really useful objects for designing multi-threaded applications in Java, and they have been introduced - alongside a lot of excellent other classes - in Java 5, as part of the java.util.concurrent package. If you don’t know about them, you should really read the ex...