-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
rt: Change max_threads
to max_blocking_threads
#3287
Conversation
tokio/src/runtime/builder.rs
Outdated
let blocking_pool = blocking::create_blocking_pool(self, self.max_threads); | ||
let blocking_pool = blocking::create_blocking_pool(self, self.max_blocking_threads); |
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.
It seems like we need an additional change to the blocking pool. Maybe you need to add the number of worker threads to this one, or change the blocking pool itself?
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 don't see anywhere where we do worker_threads - max_threads
to get the cap. Maybe @carllerche can chime in here?
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.
This should be worker_threads + max_blocking_threads
I think.
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.
Eventually, we will create a special path for worker calls to spawn_blocking, but we don't have that yet.
@carllerche I made the change you requested. |
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.
This looks good for now. We can look into an option to disable spawn_blocking
in a follow-up.
Closes #2802