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

Start fewer threads in TaskRunner #8391

Merged
merged 1 commit into from Apr 29, 2024

Conversation

swankjesse
Copy link
Member

We've got a race where we'll start a thread when we need one, even if we've already started a thread. This changes TaskRunner's behavior to never add a thread if we're still waiting for a recently-added one to start running.

This is intended to reduce the number of threads contenting for the TaskRunner lock as reported in this issue:

#8388

We've got a race where we'll start a thread when we need
one, even if we've already started a thread. This changes
TaskRunner's behavior to never add a thread if we're
still waiting for a recently-added one to start running.

This is intended to reduce the number of threads contenting
for the TaskRunner lock as reported in this issue:

#8388
Copy link
Collaborator

@yschimke yschimke left a comment

Choose a reason for hiding this comment

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

Nice, very readable.

I'd curious to see if it affects the blocking on the SynchronousQueue I observed.

@swankjesse swankjesse merged commit d0b6a46 into master Apr 29, 2024
20 checks passed
@swankjesse swankjesse deleted the jwilson.0428.start_fewer_threads branch April 29, 2024 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants