-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add a config flag to experiment with some work item prioritization changes in cases involving a lot of sync-over-async #103983
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
Merged
Conversation
This file contains hidden or 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
…anges in cases involving a lot of sync-over-async Some services that use a lot of sync-over-async were seen to experience stalls due to some priority inversion issues in work items that get queued to the thread pool. For instance, a work item W1 queues another work item W2 to the global queue and blocks waiting for a task to complete, where W2 would need to run in order to complete the task, but W2 is queued behind a number of other work items that operate like W1, and this sometimes leads to long-duration stalls. This change adds an experimental config option that when enabled, enqueues some kinds of work items to a new low-priority global queue that is checked after all other global queues. This was seen to help in some cases.
Contributor
|
Tagging subscribers to this area: @mangod9 |
This was referenced Jun 26, 2024
Open
stephentoub
reviewed
Jul 3, 2024
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Jul 3, 2024
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs
Show resolved
Hide resolved
stephentoub
reviewed
Jul 3, 2024
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs
Show resolved
Hide resolved
stephentoub
approved these changes
Jul 3, 2024
This was referenced Jul 4, 2024
This was referenced Jul 5, 2024
matouskozak
added a commit
to matouskozak/runtime
that referenced
this pull request
Jul 11, 2024
…ation changes in cases involving a lot of sync-over-async (dotnet#103983)" This reverts commit 4882c61.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Some services that use a lot of sync-over-async were seen to experience stalls due to some priority inversion issues in work items that get queued to the thread pool. For instance, a work item W1 queues another work item W2 to the global queue and blocks waiting for a task to complete, where W2 would need to run in order to complete the task, but W2 is queued behind a number of other work items that operate like W1, and this sometimes leads to long-duration stalls. This change adds an experimental config option that when enabled, enqueues some kinds of work items to a new low-priority global queue that is checked after all other global queues. This was seen to help in some cases. The change is limited to CoreCLR for experimentation.