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

Fixes #12154 - Limit concurrent virtual threads. #12155

Merged

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Aug 10, 2024

Updated VirtualThreadPool to limit the number of concurrent virtual threads using a Semaphore.

Updated modules and documentation.

Updated VirtualThreadPool to limit the number of concurrent virtual threads using a Semaphore.

Updated modules and documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@gregw
Copy link
Contributor

gregw commented Aug 10, 2024

@sbordet can we make this do if anybody configures the limit to less than 10000 it does "warning: just use normal threads. The emperor is indeed naked!"

@sbordet
Copy link
Contributor Author

sbordet commented Aug 10, 2024

@gregw sure, but I think you meant "less than a million" 🤣

#jetty.threadPool.namePrefix=vtp<hashCode>

## Maximum number of concurrent virtual threads.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think "concurrent" is correct or necessary here. It makes it sound like there could be a lot more virtual threads, but only a limited number concurrently executing (which is a factor of cores and/or native threads).

Suggested change
## Maximum number of concurrent virtual threads.
## Maximum number of live virtual threads.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet requested a review from gregw August 20, 2024 08:36
gregw
gregw previously approved these changes Aug 20, 2024
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet merged commit 0644aaf into jetty-12.0.x Aug 21, 2024
5 of 9 checks passed
@sbordet sbordet deleted the fix/jetty-12.0.x/12154/add-semaphore-virtual-threads branch August 21, 2024 08:44
sbordet added a commit that referenced this pull request Aug 23, 2024
Updated VirtualThreadPool to limit the number of concurrent virtual threads using a Semaphore.

Updated modules and documentation.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
2 participants