Java 24

Virtual Threads and Pinning Removal

  • Biggest excitement is around “no pinning” for virtual threads when entering synchronized blocks (JEP 491).
  • Previously, virtual threads could pin carrier threads under locks, harming scalability and even causing deadlocks when carrier threads were exhausted.
  • Now, people feel safe running existing synchronized-heavy code (e.g., JDBC, ORMs, connection pools) on virtual threads without refactoring to ReentrantLock.
  • Some ask how common “lock while doing I/O” really is; others report it occurs in real-world libraries and was a practical problem.

Impact on Async / Event-Loop Libraries

  • Some commenters claim virtual threads largely remove the need for complex async/event-loop paradigms (Netty, reactive stacks) for I/O-bound workloads.
  • Pushback: event-loop models still have advantages (no locking, simpler shared-state reasoning on a single-threaded loop), so they’re not “obsolete,” just less necessary for scalable concurrency.

Structured Concurrency and Concurrency Models

  • Strong interest in structured concurrency leaving preview, seen as closing a gap with Go and improving “fire off N tasks + wait + collect errors” patterns.
  • Discussion compares Java’s direction to Go (goroutines criticized as “unstructured”) and Kotlin (coroutines seen as more ergonomic but also more complex to integrate across platforms).
  • Some miss explicit async/await, others argue virtual threads make “awaits” implicit and avoid function coloring.

Security Manager Removal

  • Controversial: some see its removal as a needless loss of a unique sandboxing feature that could help with supply-chain attacks.
  • Others argue it was rarely used, hard to maintain, and ineffective compared to OS/container sandboxing; removal is framed as a major maintainability win.
  • Debate over whether the impact on existing SecurityManager-dependent systems is significant; usage is claimed to be “tiny,” but not quantified.

Other Notable Features & JEPs

  • Stream Gatherers (e.g., sliding windows) praised as a powerful extension of Streams.
  • Stabilized FFI, AOT linking, Compact Object Headers v2, and Classfile API (JEP 484) are highlighted as important, especially for tooling and startup performance.
  • Many expect structured concurrency and more Valhalla pieces (e.g., generics over primitives, nullability) in upcoming LTS releases.

Licensing and Distributions

  • Confusion over Oracle JDK licensing: some say “free but must stay on latest,” others advise avoiding Oracle builds unless required by enterprise contracts.
  • Consensus: most users should prefer OpenJDK-based distributions (e.g., Amazon Corretto, Temurin); functionally similar, fewer licensing headaches.

Java vs Kotlin/Scala and Ecosystem

  • Java is seen as rapidly closing the feature gap with Kotlin (records, pattern matching, sealed types); Kotlin still ahead on nullability and conciseness.
  • Some prefer Kotlin or Scala for expressiveness; others value Java’s stability, tooling, and “host language” status on the JVM.
  • Commenters note many organizations are still on Java 8 or 11, missing recent improvements but often prioritizing stability and other work.