Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 2.07 KB

File metadata and controls

36 lines (27 loc) · 2.07 KB

Overview

  1. TODO

Java 21 changes

Virtual Threads

  1. Use simple "blocking" style IO with Virtual Thread
  2. Alternative to CompletableFuture style development
    1. Choose either CompletableFuture or Virtual Threads, not both
    2. There's no point to use with CompletableFuture
  3. Alternative to ExecutorService style development
    1. Don't use with thread pools (there's no point)
  4. Meant for IO (like tokio) and Java NIO
    1. NOT meant CPU bound parallelism (like rayon) or Parallel streams
  5. See https://openjdk.org/jeps/444
  6. Performance: Usually need > 10K virtual threads to benefit

Structured concurrency

  1. StructuredTaskScope
    1. Feels like ExecutorService with a better API
    2. Simpler cancellation
    3. Simpler waiting
    4. See https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html
    5. See https://docs.oracle.com/en/java/javase/21/core/structured-concurrency.html
    6. fork subtasks, then join
    7. See https://openjdk.org/jeps/453
  1. TODO:

Other Resources

  1. TODO