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

BasicTaskflow should let us specify the Closure type #70

Closed
Lectem opened this issue Mar 17, 2019 · 2 comments
Closed

BasicTaskflow should let us specify the Closure type #70

Lectem opened this issue Mar 17, 2019 · 2 comments

Comments

@Lectem
Copy link

Lectem commented Mar 17, 2019

Hi,

I think it would be great if we could define our own Closure type for BasicTaskflow, and for multiple reasons:

  • One could limit the usage to a fixed sized type instead of relying on std::function. For example use a function_ref http://wg21.link/p0792
  • One could implement Executors that would recognize properties of the Closure, such as priority, long running task, IO task. What I'm thinking about here is having something similar to the windows threadpool https://docs.microsoft.com/fr-fr/windows/desktop/ProcThread/thread-pool-api that can spawn more threads when needed, or change their priority.
  • On some systems, some functions are restricted to a given CPU core, we could imagine adding some kind of core affinity to the closure

Some of those features could be implemented by other means, but I think customizing the BasicTaskflow::Closure type would be the easiest way to have a system with mixed requirements.

@clin99
Copy link
Collaborator

clin99 commented Mar 19, 2019

Hi @Lectem , sorry for my reply. I agree that allowing Closure customization would be beneficial to
the users that have their own executors and allows more dedicated scheduling strategies for different kinds of tasks. As currently Closure is the main data structure used in both BasicTaskflow and the underlying executor, we need to think carefully about how to do this. We will add this into our TODO list.

Thanks for your feedback!

@tsung-wei-huang
Copy link
Member

The current version does not plan to do this but leave it with std::function

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

No branches or pull requests

3 participants