Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8304919: Implementation of Virtual Threads #13203

Closed
wants to merge 13 commits into from

Conversation

AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Mar 28, 2023

JEP 444 proposes to make virtual threads a permanent feature in Java 21. The APIs that were preview APIs in Java 19/20 are changed to permanent and their @since/equivalent are changed to 21 (as per the guidance in JEP 12). The JNI and JVMTI versions are bumped as this is the first change in 21 to need the new version number. A lot of tests are updated to drop @enablePreview and --enable-preview.

There is one API change from Java 19/20, the preview API Thread.Builder.allowSetThreadLocals(boolean) is dropped. This requires an update to the JVMTI GetThreadInfo implementation to read the TCCL consistently.

In addition, there are a small number of implementation changes to sync up from the loom fibers branch:

  • A number of stack frames are @Hidden to reduce noise in the stack traces. This exposed a few issues with the stack walker code. More specifically, the cases where end of a continuation falls precisely at the end of the batch, or where the remaining frames are hidden, weren't handled correctly.
  • The code to emit the JFR jdk.ThreadSleepEvent is refactored so it's in Thread rather than in two classes.
  • A few robustness improvements for OOME and SOE. There is more to do here, for future PRs.
  • New system property to print a stack trace when a virtual thread sets its own value of a TL.
  • ThreadPerTaskExecutor is changed to use FutureTask.

Testing: tier1-6.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8304920 to be approved

Issues

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13203/head:pull/13203
$ git checkout pull/13203

Update a local copy of the PR:
$ git checkout pull/13203
$ git pull https://git.openjdk.org/jdk.git pull/13203/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13203

View PR using the GUI difftool:
$ git pr show -t 13203

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13203.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 28, 2023

👋 Welcome back alanb! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Mar 28, 2023
@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@AlanBateman The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot
  • jmx
  • net
  • nio
  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org jmx jmx-dev@openjdk.org hotspot hotspot-dev@openjdk.org nio nio-dev@openjdk.org core-libs core-libs-dev@openjdk.org net net-dev@openjdk.org labels Mar 28, 2023
@AlanBateman
Copy link
Contributor Author

/label remove jmx
/label remove nio
/label remove net

@openjdk openjdk bot removed the jmx jmx-dev@openjdk.org label Mar 28, 2023
@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@AlanBateman
The jmx label was successfully removed.

@openjdk openjdk bot removed the nio nio-dev@openjdk.org label Mar 28, 2023
@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@AlanBateman
The nio label was successfully removed.

@openjdk openjdk bot removed the net net-dev@openjdk.org label Mar 28, 2023
@openjdk
Copy link

openjdk bot commented Mar 28, 2023

@AlanBateman
The net label was successfully removed.

@AlanBateman AlanBateman marked this pull request as ready for review March 28, 2023 10:49
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 28, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 28, 2023

Copy link
Contributor

@plummercj plummercj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serviceability changes look good.

@sspitsyn
Copy link
Contributor

I looked at Serviceability changes and related tests. They are good.

@AlanBateman
Copy link
Contributor Author

This becomes obsolete:
src/hotspot/share/prims/jvmtiTagMap.cpp: // disabled if vritual threads are enabled with --enable-preview

A left-over from JDK-8285739, thanks, we can remove that comment.

@openjdk
Copy link

openjdk bot commented Apr 6, 2023

@AlanBateman This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8304919: Implementation of Virtual Threads

Reviewed-by: lmesnik, cjplummer, psandoz, mchung, sspitsyn, jpai

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • dc81603: 8305666: Add system property for fair AWT lock

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed csr Pull request needs approved CSR before integration labels Apr 6, 2023
Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates Alan, they look fine to me.

I've gone through the java side changes in this PR and the tests (except for hotspot tests) and they all look fine to me.

@AlanBateman
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Apr 11, 2023

Going to push as commit 2586f36.
Since your change was applied there have been 22 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 11, 2023
@openjdk openjdk bot closed this Apr 11, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 11, 2023
@openjdk
Copy link

openjdk bot commented Apr 11, 2023

@AlanBateman Pushed as commit 2586f36.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org
9 participants