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

Threadpool should have an API for waiting for spawned tasks #1349

Open
withoutboats opened this issue Nov 25, 2018 · 3 comments
Open

Threadpool should have an API for waiting for spawned tasks #1349

withoutboats opened this issue Nov 25, 2018 · 3 comments
Labels
A-executor Area: futures::executor C-feature-request S-needs-implementation Status: Implementation work is needed.

Comments

@withoutboats
Copy link

If you spawn a bunch of tasks on the threadpool from the main thread, and then the main thread concludes, the program will terminate before the threadpool's tasks have finished. Ideally, there'd be an easy way to ensure that all the spawned tasks conclude before the program ends.

@Nemo157
Copy link
Member

Nemo157 commented Nov 25, 2018

I thought that’s what ThreadPool::run did, but it appears it’s only LocalPool::run that behaves this way. Would be good to have consistent naming and behaviour between pools as well.

@Diggsey
Copy link
Contributor

Diggsey commented Jul 7, 2020

It's pretty hard to use thread-pool without some way to wait for its tasks to complete.

@alexanderlinne
Copy link

Is there anyone working on this? I'd be happy to implement a join function

@taiki-e taiki-e added the A-executor Area: futures::executor label Dec 17, 2020
@taiki-e taiki-e added this to the futures-0.4 milestone Dec 17, 2020
@taiki-e taiki-e added the S-needs-implementation Status: Implementation work is needed. label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-executor Area: futures::executor C-feature-request S-needs-implementation Status: Implementation work is needed.
Projects
None yet
Development

No branches or pull requests

6 participants