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

[Question] About the performance of ThreadSafeFury when using VirtualThread #2084

Open
moooonk opened this issue Feb 26, 2025 · 1 comment
Open
Labels
question Further information is requested

Comments

@moooonk
Copy link
Contributor

moooonk commented Feb 26, 2025

Question

ThreadSafeFury uses ThreadLocal to ensure thread safety, which causes it to create a Fury object for each thread, even if the thread type is VirtualThread. We know VirtualThread is designed as a lightweight thread with an extremely short lifecycle, where creation and destruction occur very frequently. However, the creation cost of Fury objects is very high. In this scenario, the current implementation of ThreadSafeFury will lead to significant resource consumption. Do you have any suggestions for addressing this issue?

@moooonk moooonk added the question Further information is requested label Feb 26, 2025
@moooonk
Copy link
Contributor Author

moooonk commented Feb 26, 2025

I found ThreadPoolFury,this seems to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant