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
Add OS thread suspension #3046
Merged
Merged
Add OS thread suspension #3046
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…erminated function
One version takes the thread number and the other cleans up in all worker threads.
Add HPX_EXPORT to hopefully fix msvc build errors.
Preparation for adding suspension which can be more relaxed.
Testing the wrong thing, the correct functions are not yet implemented.
This breaks some tests again with the latest commit, but I think I know the cause. Will try to fix it tomorrow. |
sithhell
approved these changes
Dec 8, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as advertised!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds functionality to suspend and resume threads (and fixes throttling, thus replaces #2994).
Notes:
cleanup_terminated
only cleans up terminated threads and returns true if there are none left (the checks for remaining work have been moved out to the scheduling loop){remove,add,suspend,resume}_processing_unit
andcreate_thread
(in schedulers) are locked with thread specific mutexes to avoid scheduling work when a pu is being suspended/removed (but the lock increate_thread
is only taken if elasticity is enabled)create_thread
checks the state of the scheduler to decide if it's running or not instead of checkingused_processing_units
(but again only if elasticity is enabled)used_processing_units
mask is only used for setting the affinity of service threadsused_processing_units
mask is recomputed when requested to account for removed/suspended pus and different affinity masks per puSome schedulers are not tested: