-
Notifications
You must be signed in to change notification settings - Fork 985
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
Virtual thread support for sync api's #3085
Comments
Hey @luvk1412 thanks for submitting this. @mp911de already investigated this as part of #1429 I do, however, think we can address some of the places in this list, even if it is for future proofing. I will keep this open and submit a few fixes. Please let me know if you run into specific instances of this issue. |
@tishun thanks for replying, my concern wasn't around that netty's eventloop should use virtual threads, its totally fine if eventloop is using platform threads. My concern was more around if any of the mentioned
Also came across JEP 491 after which maybe this is not a concern anymore as well. |
This JEP seems to be scheduled for JDK 24. JDK 21 to 23 would still have virtual threads that pin threads in case of synchronized blocks so the change seems reasonable. |
Feature Request
Is your feature request related to a problem? Please describe
I am writing a server which would run on virtual threads and i am also using lettuce sync api's in my app. On a quick search i can see there are usages of
synchronized
in the code ( check here ), I am worried that these usages can lead to platform thread pinning especially the usages inMasterReplicaConnectionProvider.java
, I am not sure about the fact if platform thread would pin, as i am not aware if the methods usingsynchronized
would run on eventloop or the virtual thread in some case, so please correct me if I am wrong here.In case these usages are potential cause for thread pinning, it would be great if we can remove those usages and make library virtual thread compatible.
Describe the solution you'd like
Replace
synchronized
withReentrantLock
as done in spring-projects/spring-data-redis#2690 as well.The text was updated successfully, but these errors were encountered: