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

Non blocking ReservedThreadExecutor (#6535) #6559

Merged
merged 1 commit into from Jul 29, 2021

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Jul 29, 2021

Port of #6535 from jetty-9 for #6495

A call to offer must never block, nor even yield, since to do so give an opportunity for the allocated CPU core to change, defeating the whole purpose of the class.
There is also some reasonable level of diagnostic warnings if a reserved thread misses too many offers consecutively, based on tracking the state of the reserved thread.

Remove the stack data structure entirely. ReservedThreads all poll the same SynchronousQueue and tryExecute does a non blocking offer.

Added test for busy shrinking

Remember last time we hit zero reserved threads

Co-authored-by: Simone Bordet simone.bordet@gmail.com

A call to offer must never block, nor even yield, since to do so give an opportunity for the allocated CPU core to change, defeating the whole purpose of the class.
There is also some reasonable level of diagnostic warnings if a reserved thread misses too many offers consecutively, based on tracking the state of the reserved thread.

Remove the stack data structure entirely.  ReservedThreads all poll the same SynchronousQueue and tryExecute does a non blocking offer.

Added test for busy shrinking

Remember last time we hit zero reserved threads

Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
@gregw gregw requested review from lorban and sbordet July 29, 2021 00:03
@gregw gregw merged commit 6201d3b into jetty-10.0.x Jul 29, 2021
@gregw gregw deleted the jetty-10.0.x-6495-ReservedThreadExecutor3 branch July 29, 2021 23:09
@sbordet sbordet added this to In progress in Jetty 10.0.7/11.0.7 FROZEN via automation Sep 20, 2021
@sbordet sbordet moved this from In progress to Done in Jetty 10.0.7/11.0.7 FROZEN Sep 20, 2021
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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants