- TODO
- Use simple "blocking" style IO with Virtual Thread
- Alternative to CompletableFuture style development
- Choose either
CompletableFutureor Virtual Threads, not both - There's no point to use with
CompletableFuture
- Choose either
- Alternative to
ExecutorServicestyle development- Don't use with thread pools (there's no point)
- Meant for IO (like tokio) and Java NIO
- NOT meant CPU bound parallelism (like rayon) or Parallel streams
- See https://openjdk.org/jeps/444
- Performance: Usually need > 10K virtual threads to benefit
StructuredTaskScope- Feels like
ExecutorServicewith a better API - Simpler cancellation
- Simpler waiting
- See https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html
- See https://docs.oracle.com/en/java/javase/21/core/structured-concurrency.html
forksubtasks, thenjoin- See https://openjdk.org/jeps/453
- Feels like
- TODO:
- TODO