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

Update the blocking threadpool so that threads that are idle are shut down. #1514

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

jnicholls
Copy link
Contributor

Update the blocking threadpool so that threads that are idle for KEEP_ALIVE seconds without any queued work will be shutdown. As of now, KEEP_ALIVE does nothing of consequence and threads that are spawned into the pool will never be shutdown during runtime.

…_ALIVE seconds without any queued work will be shutdown.
@DoumanAsh
Copy link
Contributor

I think ideally before we could do something like that, keep-alive should be configurable...
Not sure to be honest.
Keeping idle threads is bad, but if user will constantly use it with some interval bigger than current keep-alive he gonna get to re-create these threads

@carllerche
Copy link
Member

I think ideally before we could do something like that, keep-alive should be configurable...

100%... before 0.2 final I would like the threadpool implementation to be configurable as part of the runtime. I am punting on this initially though as I think it will be easier to polish all this stuff off once Tokio 0.2 is "feature complete.

Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

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

This is a great next step. Thanks 👍

@carllerche carllerche merged commit 3d9134d into tokio-rs:master Aug 30, 2019
@jnicholls jnicholls deleted the blocking_keep_alive branch August 30, 2019 15: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.

3 participants