Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] JDK 19 - Virtual Threads Testing!
  • From: David Delabassee <david.delabassee@xxxxxxxxxx>
  • Date: Mon, 16 May 2022 10:18:43 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LI9LPYuaUXZDOwmDWTfI95b8iU0DejteetSRuXQL1r8=; b=IsdYqjoMEzGb6TdiY06vBZava64WNgPmpIu0K6YP6eSoXhTd0JjG179tcnSUfSxQyfl53RPj+hDMPz7KEJ3EctlzZBL/C0DADlj2vMwzti+yPwVFAIzfE0jGd3gg0/2LYYsRONIDyGtRTpiSQU7FTolNVcIt80QUtYGSj0xpbHcF8jVxVYUVoH9hbEqhxz+xqDDs9jsjcEBTlDXOy0nBShrMtsEyPRxKr++u105TZyCvHM52dI0W3gs4o4UA4i5xUvr4Z2acGUV+SuaKmAqUo8kLShezhMCDiJLGxydkTLCAAKYa8e0FiDDseawPDIVOLG11ZrfN4MRxKthggC7lVw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IL8tEOtgOlG/xUW+2XImEc7d7hnfoVuRDMEDkmmt38dV7KKGc1axXVyM1Mj3BDvT8sn1t97Ti+372wa4z0hLtVSFu7SeXEZcHVHXioWp1Y4tQf7NyPW+vqLXbhTyIr4lQ8yOgj/CGISjddNkB1q+2W6XghMx6tNxM31tjdY5MIDrvvc8t5zPWn0iTGUsyH+97X1Mc4RQ5FZ5XCRa3zBmF7kxo4Vj79JQj5XHn7bcE5TO0RXEfy94zC5Yk9JtXjPIloZDt+Mj6RM3qfUAmgnopug8T8mtbfeh46utc3W45+tdltHJda2dtLyXJPHWv71/2MklXuDfZOVA3aYcsvXbWA==
  • Delivered-to: jetty-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jetty-dev/>
  • List-help: <mailto:jetty-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jetty-dev>, <mailto:jetty-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jetty-dev>, <mailto:jetty-dev-request@eclipse.org?subject=unsubscribe>
  • User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0

Welcome to a new OpenJDK Quality Outreach update!

This time, we have one update but a major one: JEP 425 (Virtual Threads preview) has been integrated into the OpenJDK mainline! JDK 19 Early-Access builds 22 are the first mainline builds with Virtual Threads (preview) support. So, Project Loom is now getting closer and closer!

Please make sure to check the Heads-up below even if you don’t intend to use virtual threads in the short future.


## Heads-up - JEP 425 Virtual Threads (preview) testing

The goal of Project Loom is to introduce in the Java platform an easy-to-use, high-throughput lightweight concurrency model, and a related new concurrent programming model.

Developed in Project Loom, JEP 425 introduces 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. Note that virtual threads are a preview API in JDK 19. Please make sure to read 'JEP 425: Virtual Threads (Preview)' for a detailed explanation.

A lot of testing has already been done but we are asking, once again, your help to test your project(s) with the latest JDK 19 Early-Access builds, even if you don’t intend to use virtual threads any time soon.

There are two approaches to test your project:
1. Update your code to use virtual threads …or
2. Simply test your existing unchanged code with the preview feature enabled.

Both approaches should yield valuable feedback.

If you choose to adapt your application to use virtual threads (cf. JavaDoc [2]), be aware that in some cases it’s not just about updating your code to use virtual threads instead of platform threads; there are some additional considerations. For example, virtual threads shouldn’t be pooled [3], code that relies heavily on thread locals [4] will require some work to move to a world where there is a new thread for each task, etc.

Given that are some minor behavior changes and that `ThreadGroup` has been degraded, testing your code as-is, i.e., without using virtual threads but with the preview feature enabled at runtime, will also be useful. For more details, please check 'JEP 425 - Risks and Assumptions' [5].

One difference between to the EA builds published by Project Loom and the latest JDK 19 EA builds is that the `--enable-preview` flag is required at run-time to use the new APIs. It’s not possible to use the APIs with core reflection to avoid the need for `--enable-preview`.

Finally, some tools especially tools relying on JVM TI agents might not be fully ready for virtual threads.

Your help testing this important update is greatly appreciated, all feedback should be sent to the 'loom-dev' mailing list [6].

[1] https://openjdk.java.net/jeps/425
[2] https://download.java.net/java/early_access/jdk19/docs/api/java.base/java/lang/Thread.html
[3] https://openjdk.java.net/jeps/425#Do-not-pool-virtual-threads
[4] https://openjdk.java.net/jeps/425#Thread-local-variables
[5] https://openjdk.java.net/jeps/425#Risks-and-Assumptions
[6] https://mail.openjdk.java.net/pipermail/loom-dev/


## JDK 19 Early-Access builds

JDK 19 Early-Access builds 22 are now available [7], and are provided under the GNU General Public License v2, with the Classpath Exception. Make sure to check the Release Notes [8] and the JavaDoc [9].

[7] https://jdk.java.net/19/
[8] https://jdk.java.net/19/release-notes
[9] https://download.java.net/java/early_access/jdk19/docs/

### Current JDK 19 JEPs
- 405: Record Patterns (Preview) - Proposed to target
- 422: Linux/RISC-V Port - Integrated
- 424: Foreign Function & Memory API (Preview) - Integrated
- 425: Virtual Threads (Preview) - Integrated
- 426: Vector API (4th Incubator) - Targeted
- 427: Pattern Matching for switch (3rd Preview) - Targeted

### Recent changes that may be of interest:

Build 22:
- JDK-8284161: Implementation of Virtual Threads (Preview)
- JDK-8285947: Avoid redundant HashMap.containsKey calls in ZoneName
- JDK-8212136: Remove finalizer implementation in SSLSocketImpl
- JDK-8285872: JFR: Remove finalize() methods
- JDK-8285914: AppCDS crash when using shared archive with old class file
- JDK-8286163: micro-optimize Instant.plusSeconds
- JDK-8282420: JFR: Remove event handlers
- JDK-8282559: Allow multiple search terms in javadoc search

Build 21:
- JDK-8255552: Add DES/3DES/MD5 to jdk.security.legacyAlgorithms
- JDK-8278370: [win] Disable side-by-side installations of multiple JDK updates in Windows JDK installers - JDK-8281010: [macos] Disable side-by-side installations of multiple JDK updates in macOS JDK installers
- JDK-8236128: Allow jpackage create installers for services
- JDK-8279598: provide adapter from RandomGenerator to Random

Build 20:
- JDK-8284553: Deprecate the DEFAULT static field of OAEPParameterSpec
- JDK-8283620: System.out does not use the encoding/charset specified in the Javadoc
- JDK-8285445: Enable Windows Alternate Data Streams by default
- JDK-8284930: Re-examine FilterInputStream mark/reset
- JDK-8284890: Support for Do not fragment IP socket options
- JDK-8282823: javac should constrain more uses of preview APIs
- JDK-8285477: Add a PRECISION public static field to j.l.Float and j.l.Double

Build 19:
- JDK-8186958: New Methods to Create Preallocated HashMaps
- JDK-8284775: Simplify String.substring(_, length()) calls
- JDK-8283892: Compress and expand bits
- JDK-8280915: Better parallelization for AbstractSpliterator and IteratorS…
- JDK-8284681: compiler/c2/aarch64/TestFarJump.java fails with "RuntimeExce…
- JDK-8283790: G1: Remove redundant card/heap-address transition
- JDK-8285001: Simplify StringLatin1.regionMatches
- JDK-8284880: Re-examine sun.invoke.util.Wrapper hash tables
- JDK-8278356: Improve file creation


## Topics of Interest

- Java Cryptographic Roadmap update https://java.com/en/jre-jdk-cryptoroadmap.html - Virtual Thread Deep Dive https://inside.java/2022/04/07/insidejava-newscast-023/ - Why Write an Empty finalize() Method? https://stuartmarks.wordpress.com/2022/04/27/why-write-an-empty-finalize-method/ - WHEN and NULL In Pattern Matching https://inside.java/2022/05/05/insidejava-newscast-024/ - JDK 8 to JDK 18 in GC: 10 Releases, 2000+ Enhancements https://inside.java/2022/05/02/odl-jdk8-to-jdk18-gc/
- ZGC - What's new in JDK 18 https://malloc.se/blog/zgc-jdk18
- Java Next - From Amber to Loom, from Panama to Valhalla https://inside.java/2022/05/09/java-next/


## JDK Update Patch Release

As announced with the April 2022 CPU release, we have produced update patch releases for all Java SE supported versions. The new versions are JDK 18.0.1.1 (publicly available), 17.0.3.1 (publicly available), 11.0.15.1, 8u333, 7u343, and OpenJDK 18.0.1.1 (publicly available).


As usual, let us know if you find any issues while testing your project(s) on the latest JDK early-access builds. Thanks for your support!

--David






Back to the top