-
Notifications
You must be signed in to change notification settings - Fork 169
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
Bad performance locking #1688
Comments
@l3r8yJ please, submit a PR! |
@fabriciofx sure |
Hello @l3r8yJ, IMO this is actually incorrect, see my comment in the PR (#1689 (comment)). That being said, the change is maybe anyway relevant (see https://stackoverflow.com/a/11821900), but let's be first clear about what it provides so that it can be documented and maybe applied more generally in the code base. |
@victornoel Hi. I didn't fully understand what |
@l3r8yJ IMO means in my opinion (as the ARC of this project ;). The link you gave is the same I gave and it does not support at all the claims that "code is not parallel" (whatever that means...). Just that there is one advantage in our situation: support for Java 21 Virtual Threads. To be precise, the code change you propose:
The only relevant advantages I see are:
Those are good reasons, but has nothing to do with the description of the opened ticket. If you agree with this conclusion, I will add a comment in the PR to take this discussion into account so that we can record those conclusions. If you have other advantages in mind please share them so that we can also record them. |
actually this code is not parallel at all because of the
synchronized
keyword, I suggest usingreentrant lock
, wdyt?cactoos/src/main/java/org/cactoos/scalar/Synced.java
Line 82 in 9ee0dd1
The text was updated successfully, but these errors were encountered: