-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support Loom #8007
Comments
Implemented virtual threads support for HTTP/1.1, HTTP/2 and HTTP/3. Signed-off-by: Simone Bordet <[email protected]>
Updates after review. Signed-off-by: Simone Bordet <[email protected]>
Alternative implementation of support for virtual threads for HTTP/1.1, HTTP/2 and HTTP/3. The virtual thread support is in AdaptiveExecutionStrategy. When virtual threads are supported and enabled, reserved threads are disabled and blocking tasks are run in a virtual thread instead that being executed by the Executor. Signed-off-by: Simone Bordet <[email protected]>
Just a quick comment to say that testing if the Thread.startVirtualThread method is present will help detect if the runtime is 19+, using Runtime.version().feature() >= 19 would be simpler. Also just to say that this method throws UOE if not running with --enable-preview. One thing you might want to consider is creating an ExecutorService with Executors.newVirtualThreadExecutor rather than using the Thread API directly. I understand the change here is more of "hand off" rather than a deep change but once advantage of using an ES is that it will mean the virtual threads are tracked and it means they will show up in thread dumps and serviceability tools. At this time, virtual threads that are created directly with the Thread API aren't visible to serviceability tools because they aren't party of any "grouping". |
@AlanBateman thanks for the suggestions! We'll make the changes. |
Now using Executors.newVirtualThreadPerTaskExecutor() to execute tasks, so the executor is tracked by the runtime for thread dumps, etc. Signed-off-by: Simone Bordet <[email protected]>
Now using Executors.newVirtualThreadPerTaskExecutor() to execute tasks, so the executor is tracked by the runtime for thread dumps, etc. Signed-off-by: Simone Bordet <[email protected]>
Target Jetty version(s)
10.0.x
Enhancement Description
With project Loom being integrated in Java 19+22, we should offer an option to call
Handler
s with a virtual thread.This would allow testing by early adopters.
The text was updated successfully, but these errors were encountered: