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

Use virtual threads instead of a thread pool #18

Open
amanteaux opened this issue Dec 15, 2022 · 1 comment
Open

Use virtual threads instead of a thread pool #18

amanteaux opened this issue Dec 15, 2022 · 1 comment

Comments

@amanteaux
Copy link
Member

Virtual threads are becoming a reality since Java 19, though currently they are only available through preview usage of the JVM: --enable-preview.

When virtual threads are fully part of the JVM, Wisp core should be rewritten to use virtual threads:

  • It should actually consume less hardware resources
  • The core code will be smaller and easier to maintain
  • There will be no more need to configure the thread pool since virtual thread pooling is not recommended
@amanteaux
Copy link
Member Author

For now this is paused because virtual threads must use only code that is not dependent on the synchronized keyword. Since this keyword is used widely in the JDK itselft, it is not safe enough to rely on virtual threads. Especially when the gains are not clear. When this feature is implemented, a benchmark needs to clarify the gains of switching to virtual threads.

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

No branches or pull requests

1 participant