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

RFC for the task arena waiting functionality #1617

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akukanov
Copy link
Contributor

@akukanov akukanov commented Jan 27, 2025

Description

A proposal to extend the API of task arena with work completion waiting methods.

Co-authored-by: Mike Voss <[email protected]>
Copy link
Contributor

@aleksei-fedotov aleksei-fedotov left a comment

Choose a reason for hiding this comment

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

I like it. Why is it in draft state? Do you want to elaborate something or write the other idea(s) regarding the waiting of work completion in arenas?

@akukanov
Copy link
Contributor Author

I like it. Why is it in draft state? Do you want to elaborate something or write the other idea(s) regarding the waiting of work completion in arenas?

I would be happy to get it initially accepted :) The next thing is to describe the proposed APIs more formally, and perhaps elaborate on the design - for which I would really need some feedback from the development team.

@akukanov akukanov marked this pull request as ready for review January 30, 2025 18:10
@tobiasweinzierl80
Copy link
Contributor

I do appreciate this topic pops up again. I wonder however if the introduction of an unsafe wait in the tradition of a yield should not be considered, too? I.e. I do something, and then ask the arena to do at least one more task before it returns, i.e. not totally blocking but instructing the scheduler. This way, I can build in fairness into an algorithm.

@akukanov
Copy link
Contributor Author

akukanov commented Feb 5, 2025

@tobiasweinzierl80 Is the idea for an application thread to temporarily join arena and help making progress, or for it to "sleep" until some progress is made by other threads? And in any case, what would trigger the thread to return/wake up - completion of a specific task, completion of a certain amount of unspecified tasks, timeout, or an event external to the arena (or some combination of those)?

@tobiasweinzierl80
Copy link
Contributor

Very good question. In MPI, there is this context of callback points. I don't think that's require here. I think joining the other team without any further progress guarantees is the most useful thing for us. So it eventually will come back, although I don't know when.

@vossmjp
Copy link
Contributor

vossmjp commented Feb 5, 2025

It seems that at this early stage, this RFC is intended to act as an umbrella for possible task arena waiting extensions. If so, should a third category be added to include the temporary-participation case? Perhaps, the API is a generalization of the proposed task_arena::wait_for to include different wait conditions: empty-state of a task group, empty-state or the arena itself, a time or progress condition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants