4 ms·
I agree that you shouldn't be touching locks and threads, typically. However, I think you can get pretty far these days with just the built-in Java class libra
by jcrites 9y ago
I agree that you shouldn't be touching locks and threads, typically.
However, I think you can get pretty far these days with just the built-in Java class library, using features like Futures (CompletableFuture), ExecutorService, ForkJoinPool, and BlockingQueue and such. Before CompletableFuture there was Guava's ListenableFuture. Synchronized methods are also useful in certain situations. I've built several fairly sophisticated concurrent applications using these primitives and felt they worked out reasonably well. I find that BlockingQueues with thread-pool-backed ExecutorServices provide a model that's fairly robust while being simple to reason about and monitor.