-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Replace synchronized blocks with reentrant locks #702
Comments
mrotteveel
added a commit
that referenced
this issue
Sep 11, 2022
mrotteveel
added a commit
that referenced
this issue
Sep 12, 2022
Still needs a review of other uses of |
mrotteveel
added a commit
that referenced
this issue
Sep 18, 2022
mrotteveel
added a commit
that referenced
this issue
Sep 18, 2022
mrotteveel
added a commit
that referenced
this issue
Sep 18, 2022
mrotteveel
added a commit
that referenced
this issue
Sep 18, 2022
mrotteveel
added a commit
that referenced
this issue
Sep 18, 2022
Remaining synchronized uses are OK, and can remain in place. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jaybird currently uses a lot of synchronized blocks for thread-safety. Java 19 introduces virtual threads with Project Loom (as a preview feature). Virtual threads and synchronized blocks currently don't work well together (or more correctly, seriously reduce the benefits/usability of virtual threads due to thread pinning). See https://openjdk.org/jeps/425 for details. Although JEP 425 says "In a future release, we may be able to remove the first limitation above (pinning inside
synchronized
).", this is not a solved problem, and may never surface (see https://mail.openjdk.org/pipermail/jdk-dev/2022-June/006721.html).As a result, replacing synchronized blocks with reentrant locks (and maybe at the same time, look at reducing use of locks) makes sense to allow Jaybird to make use of virtual thread without pinning (that is, for the pure-java protocol, as calling native methods will still cause pinning).
The text was updated successfully, but these errors were encountered: