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

[Manager] Sort requests to suspend/resume/abort multiple tasks #5178

Merged
merged 3 commits into from
Apr 4, 2023
Merged

[Manager] Sort requests to suspend/resume/abort multiple tasks #5178

merged 3 commits into from
Apr 4, 2023

Conversation

BrianNixon
Copy link
Contributor

Resolves #1024 by making the Manager smarter when suspending/​resuming/​aborting multiple tasks at once.

When suspending or aborting multiple tasks, the requests are sorted to prevent the situation where as soon as a running task is stopped, a slot becomes free and the client immediately starts the next ready task, not knowing that the user wants to suspend/​abort that one as well.

When resuming multiple tasks, the ordering is reversed to favour resuming tasks that have already started over those that have not.

@davidpanderson
Copy link
Contributor

I've taken to using e.g.
for (RESULT* rp: results_to_resume) {
...

@BrianNixon
Copy link
Contributor Author

got told not to use C++11…

@AenBleidd
Copy link
Member

Thank you for the PR.

got told not to use C++11…

I believe, in this case you can break the rule and use 'range-based for loop'. Just please don't use 'auto'.

I'll try to make a full review today later

@davidpanderson
Copy link
Contributor

Now that we're using modern compilers on platforms we can use some C++11 features,
namely the ones that make code shorter and easier to read.

clientgui/ViewWork.cpp Outdated Show resolved Hide resolved
Copy link
Member

@AenBleidd AenBleidd left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you for the fix!

@AenBleidd AenBleidd merged commit 25b6bc8 into BOINC:master Apr 4, 2023
@BrianNixon BrianNixon deleted the manager_sort_requests branch April 5, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition when suspending tasks
3 participants