-
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
Experiment with fully virtual VirtualThreadPool #11501
Merged
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3a68e56
Experiment with fully virtual VirtualThreadPool
gregw c630419
Merge branch 'jetty-12.0.x' into experiment/jetty-12.0.x/fullyVirtual
gregw 8d66b30
Update from review
gregw f722a1e
Keep virtual main thread running to prevent JVM exit
gregw e1c9e24
Merge remote-tracking branch 'origin/jetty-12.0.x' into experiment/je…
gregw 66fa0bc
revert module names
gregw d5d58cd
Merge branch 'jetty-12.0.x' into experiment/jetty-12.0.x/fullyVirtual
gregw 77e185a
Updates from review
gregw 96cb6e8
Improved test of dump to always stop spinners
gregw 86ba118
Merge remote-tracking branch 'origin/jetty-12.0.x' into experiment/je…
gregw 061be04
Updates from review
gregw 34e1ea2
Updates from review
gregw 1a225ec
updates from review
gregw 0a4e6a5
updates from review
gregw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
jetty-core/jetty-server/src/main/config/etc/jetty-threadpool-all-virtual.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd"> | ||
|
||
<Configure> | ||
<New id="threadPool" class="org.eclipse.jetty.util.thread.VirtualThreadPool"> | ||
<Set name="name" property="jetty.threadPool.namePrefix" /> | ||
</New> | ||
|
||
<Call class="org.slf4j.LoggerFactory" name="getLogger"> | ||
<Arg>org.eclipse.jetty</Arg> | ||
<Call name="info"> | ||
<Arg>All Virtual threads are enabled.</Arg> | ||
</Call> | ||
</Call> | ||
</Configure> |
19 changes: 19 additions & 0 deletions
19
jetty-core/jetty-server/src/main/config/modules/threadpool-all-virtual.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[description] | ||
Enables and configures the Server ThreadPool with support for virtual threads to be used for all threads. | ||
There is some risk of CPU pinning with this configuration. Only supported in Java 21 or later. | ||
|
||
[depends] | ||
logging | ||
|
||
[provides] | ||
threadpool | ||
|
||
[xml] | ||
etc/jetty-threadpool-all-virtual.xml | ||
|
||
[ini-template] | ||
# tag::documentation[] | ||
## Platform threads name prefix. | ||
#jetty.threadPool.namePrefix=vtp<hashCode> | ||
|
||
# end::documentation[] | ||
gregw marked this conversation as resolved.
Show resolved
Hide resolved
|
3 changes: 2 additions & 1 deletion
3
jetty-core/jetty-server/src/main/config/modules/threadpool-virtual.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be more clear as in "Virtual threads enabled, using only virtual threads".
Also the file name should replace "-all-" with "-full-" or "-only-".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer "all". "full" is confusing when pools are involved. What does it mean to have a full non pooling pool? "Only" is ok, but it is just as easy to say "the threads used are all virtual", as it is to say "the threads used are only virtual". However, "only virtual" can be taken as a pejorative (which in this case might be appropriate :), so I prefer "all"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like
jetty-threadpool-only-virtual.xml