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

Replace synchronized method/block with reentrant lock (#2842) #2845

Conversation

KrnSaurabh
Copy link
Contributor

Virtual threads suffer when performing a blocking operation inside a synchronized method/block, and it is recommended that the synchronized method/block be replaced with a ReentrantLock.

More details: https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html#GUID-04C03FFC-066D-4857-85B9-E5A27A875AF9


related: #2760

Virtual threads suffer when performing a blocking operation inside a `synchronized` method/block, and it is recommended that the `synchronized` method/block be replaced with a `ReentrantLock`.

More details: https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html#GUID-04C03FFC-066D-4857-85B9-E5A27A875AF9

----

related: vavr-io#2760

Co-authored-by: karnsa <[email protected]>
@pivovarit
Copy link
Member

Thanks :)

@pivovarit pivovarit merged commit 67866da into vavr-io:version/0.x Sep 25, 2024
3 checks passed
pivovarit pushed a commit that referenced this pull request Oct 15, 2024
pivovarit pushed a commit that referenced this pull request Oct 15, 2024
pivovarit pushed a commit that referenced this pull request Oct 18, 2024
I replaced _synchronized_ blocks with Lock for the sake of Virtual Threads support. More details:
https://docs.oracle.com/en/java/javase/21/core/virtual-threads.html#GUID-04C03FFC-066D-4857-85B9-E5A27A875AF9

----
Similar to #2845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants