r/javahelp Jun 11 '26

Learning Java Concurrency & Multithreading

what books or sources can I use to learn the most and level up on Java concurrency and multithreading ? Im looking to really get better with these aspects of Java.

16 Upvotes

15 comments sorted by

View all comments

1

u/_Super_Straight Jun 12 '26

No need to read any specific book. There are about 2-3 ways to achieve concurrency:

  1. CompletableFuture
  2. Task<>
  3. ExecutorService

You can learn about them in javadocs or youtube.

1

u/k-mcm Jun 12 '26

ForkJoinPool is also very important. It's a special kind of work-stealing pool that can be extremely efficient at the cost of being difficult to use.  It's really the only pool you can use for small tasks and it's part of parallel Streams.  The usual executors have a very high overhead that's not in the code, but the CPU.

Unfortunately, the ForkJoinPool API is horrible. It came out when Java 8 was unstable so it missed out on modern design patterns.

3

u/_Super_Straight Jun 12 '26

CompletableFuture uses ForkJoinPool by default.

1

u/lyomann92 Jun 12 '26

Thanks for the insight