JDK 20 新特性概览
引入 范围值,它允许在线程内和线程间共享不可变数据。与线程局部变量相比,范围值更为优先,尤其是在使用大量虚拟线程时。这是一个孵化中的API。
JEP 429: Scoped Values (Incubator)
Introduce scoped values, which enable the sharing of immutable data within and across threads. They are preferred to thread-local variables, especially when using large numbers of virtual threads. This is an incubating API.
JEP 429: 范围值(孵化器)
引入 范围值,它允许在线程内和线程间共享不可变数据。与线程局部变量相比,范围值更为优先,尤其是在使用大量虚拟线程时。这是一个孵化中的API。
JEP 432: Record Patterns (Second Preview)
Enhance the Java programming language with record patterns to deconstruct record values. Record patterns and type patterns can be nested to enable a powerful, declarative, and composable form of data navigation and processing. This is a preview language feature.
JEP 432: 记录模式(第二次预览)
通过引入_记录模式_来增强Java编程语言,以解构记录值。记录模式和类型模式可以嵌套,从而实现强大、声明性和可组合的数据导航和处理形式。这是一个预览语言特性。
JEP 433: Pattern Matching for switch (Fourth Preview)
Enhance the Java programming language with pattern matching for switch
expressions and statements. Extending pattern matching to switch
allows an expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely. This is a preview language feature.
JEP 433: switch 的模式匹配(第四次预览)
通过为 switch
表达式和语句增强 Java 编程语言的模式匹配。将模式匹配扩展到 switch
允许一个表达式与多个模式进行测试,每个模式都有特定的操作,从而可以简洁且安全地表达复杂的数据导向查询。这是一个 预览语言特性。
JEP 434: Foreign Function & Memory API (Second Preview)
Introduce an API by which Java programs can interoperate with code and data outside of the Java runtime. By efficiently invoking foreign functions (i.e., code outside the JVM), and by safely accessing foreign memory (i.e., memory not managed by the JVM), the API enables Java programs to call native libraries and process native data without the brittleness and danger of JNI. This is a preview API.
JEP 434: 外部函数与内存API(第二次预览)
引入一个API,使Java程序能够与Java运行时之外的代码和数据进行互操作。通过高效地调用外部函数(即JVM外的代码)和安全地访问外部内存(即不由JVM管理的内存),该API使Java程序能够调用本地库并处理本地数据,而无需JNI的脆弱性和危险性。这是一个预览API。
JEP 436: Virtual Threads (Second Preview)
Introduce virtual threads to the Java Platform. Virtual threads are lightweight threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications. This is a preview API.
JEP 436: 虚拟线程(第二次预览)
向Java平台引入_虚拟线程_。虚拟线程是轻量级线程,显著减少了编写、维护和观察高吞吐量并发应用程序的工作量。这是一个预览API。
JEP 437: Structured Concurrency (Second Incubator)
Simplify multithreaded programming by introducing an API for structured concurrency. Structured concurrency treats multiple tasks running in different threads as a single unit of work, thereby streamlining error handling and cancellation, improving reliability, and enhancing observability. This is an incubating API.
JEP 437: 结构化并发 (第二次孵化)
通过引入一个用于_结构化并发_的API,简化多线程编程。结构化并发将在不同线程中运行的多个任务视为一个工作单元,从而简化错误处理和取消,提高可靠性,并增强可观察性。这是一个孵化API。
JEP 438: Vector API (Fifth Incubator)
Introduce an API to express vector computations that reliably compile at runtime to optimal vector instructions on supported CPU architectures, thus achieving performance superior to equivalent scalar computations.
JEP 438: 向量API(第五次孵化)
引入一个API,以表达向量计算,能够在运行时可靠地编译为支持的CPU架构上的最佳向量指令,从而实现优于等效标量计算的性能。