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

Remove Synchronized Statements(Loom-friendly) #173

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Remove Synchronized Statements(Loom-friendly) #173

merged 1 commit into from
Dec 22, 2023

Conversation

jchrys
Copy link
Collaborator

@jchrys jchrys commented Dec 20, 2023

Motivation:
Synchronized statements tend to pin virtual threads to carrier threads.

Modification:
Replaced synchronized statements with ReentrantLock

Result:
Loom-friendly

@mirromutth
Copy link
Contributor

After this PR is merged, we can consider removing RequestQueue.requireDisposed and RequestQueue.disposed. This is probably over-designed.

Copy link
Contributor

@mirromutth mirromutth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lock#lock() should be executed before the try statement.

How about moving lock#lock() before try statement? See the example at here.

Motivation:
Synchronized statements tend to pin virtual threads to carrier threads.

Modification:
Replaced synchronized statements with ReentrantLock

Result:
Loom-friendly
Copy link
Contributor

@mirromutth mirromutth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jchrys jchrys merged commit cf3a302 into trunk Dec 22, 2023
10 checks passed
@jchrys jchrys deleted the 1.0.x-loom branch December 22, 2023 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants