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

Refactor the thread pool and remove its dependency on statuses. #4063

Draft
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

teo-tsirpanis
Copy link
Member

@teo-tsirpanis teo-tsirpanis commented Apr 25, 2023

This PR refactors the thread pool to support working with futures of arbitrary return types, instead of only statuses. This is achieved by adding generic variants to existing methods, and changing the producer-consumer queue to store std::function<void()>s instead of std::shared_ptr<std::packaged_task<Status()>>es. The existing Status overloads remain for compatibility.

While not many things outside the thread pool are affected, this will make future "unstatusing" work easier.

TODO

  • Add generic void overloads of wait_all.
  • "Unstatus" parallel_sort as a proof of concept; it's trivial since it never returns a failing status.

TYPE: IMPROVEMENT
DESC: Refactor the thread pool.

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

1 participant