-
Notifications
You must be signed in to change notification settings - Fork 541
8293839: Documentation memory consistency effects of runLater #872
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
Conversation
Prior to this change it was not clear from the documentation if callers of Platform#runLater must perform any synchronisation to have writes of the calling thread be visible in the JavaFX Application Thread. It is important to document either if callers can rely on runLater to do such synchronisation internally, or to document is users CAN NOT rely on runLater for this. This change documents that actions in a thread prior to submitting a runnable to Platform#runLater happen-before actions performed by the runnable in the JavaFX Application Thread. runLater inherits the memory consistency effects of InvokeLaterDispatcher in most cases. InvokeLaterDispatcher uses BlockingDeque internally. This change documents this in the same way as it is documented by BlockingDeque. Other implementations of runLater should have similar memory consistency effects.
|
Hi @jensli, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user jensli" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
|
/signed |
|
Thank you! Please allow for up to two weeks to process your OCA, although it is usually done within one to two business days. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
|
@jensli I was going through the PRs that are not marked as
See CONTRIBUTING.md for more information. |
|
/summary 8293839: Document memory consistency effects of runLater |
|
@jensli Setting summary to |
|
Thanks for the help, @kevinrushforth. I was not prepared for all the rigour of the OpenJDK contribution process. This has been a perfect opportunity for me to learn about it. When my bug report submission is accepted then hopefully all formal requirements will be met. (Maybe also the internal review bug ID have to be updated to the proper bug ID.) |
Webrevs
|
|
/summary 8293839: Document memory consistency effects of runLater |
|
@jensli Updating existing summary to |
|
@kevinrushforth This is now finished. Can you review? |
|
This is now ready to review, so I'll take a look. One thing to note, though, is that the |
kevinrushforth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added description looks good. I left one suggestion on using code style for the named argument.
modules/javafx.graphics/src/main/java/javafx/application/Platform.java
Outdated
Show resolved
Hide resolved
Ah, okay, thanks. Do I remove the summary by issuing and empty Will the commit message of the squshed commit be taken from the PR description? |
modules/javafx.graphics/src/main/java/javafx/application/Platform.java
Outdated
Show resolved
Hide resolved
Yes to both questions. |
|
/summary |
|
@jensli Removing existing summary |
|
@kevinrushforth I think this is now finished. Thanks for teaching me about the OpenJDK contribution process! :) |
kevinrushforth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
|
@jensli 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: 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 28 new commits pushed to the
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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@kevinrushforth) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@jensli This is now ready for you to |
|
/integrate |
|
/sponsor |
|
Going to push as commit 7c6a54d.
Your commit was automatically rebased without conflicts. |
Prior to this change it was not clear from the documentation if callers of Platform#runLater must perform
any synchronisation to have writes of the calling thread be visible in the JavaFX Application
Thread. It is important to document either if callers can rely on runLater to do such synchronisation
internally, or to document is users CAN NOT rely on runLater for this.
This change documents that actions in a thread prior to submitting a runnable to
Platform#runLater happen-before actions performed by the runnable in the JavaFX
Application Thread.
runLater inherits the memory consistency effects of InvokeLaterDispatcher in most cases.
InvokeLaterDispatcher uses BlockingDeque internally. This change documents this
in the same way as it is documented by BlockingDeque.
Other implementations of runLater should have similar memory consistency effects.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/872/head:pull/872$ git checkout pull/872Update a local copy of the PR:
$ git checkout pull/872$ git pull https://git.openjdk.org/jfx pull/872/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 872View PR using the GUI difftool:
$ git pr show -t 872Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/872.diff