Make counting of IO completion work items more precise on Windows#112793
Merged
kouvel merged 2 commits intodotnet:mainfrom Feb 26, 2025
kouvel:PreciseIoWiCounting
Merged
Make counting of IO completion work items more precise on Windows#112793kouvel merged 2 commits intodotnet:mainfrom kouvel:PreciseIoWiCounting
kouvel merged 2 commits intodotnet:mainfrom
kouvel:PreciseIoWiCounting
Conversation
Contributor
kouvel
commented
Feb 21, 2025
- Follow-up to Stop counting work items from ThreadPoolTypedWorkItemQueue for ThreadPool.CompletedWorkItemCount #106854. Issue: ThreadPool.CompletedWorkItemCount double counting IO completion work items #104284.
- Before the change, the modified test case often yields 5 or 6 completed work items, due to queue-processing work items that happen to not process any user work items. After the change, it always yields 4.
- Looks like it doesn't hurt to have more-precise counting, and there was a request to backport a fix to .NET 8, where it's more necessary to fix the issue
- Follow-up to #106854. Issue: #104284. - Before the change, the modified test case often yields 5 or 6 completed work items, due to queue-processing work items that happen to not process any user work items. After the change, it always yields 4. - Looks like it doesn't hurt to have more-precise counting, and there was a request to backport a fix to .NET 8, where it's more necessary to fix the issue
Contributor
|
Tagging subscribers to this area: @mangod9 |
Contributor
There was a problem hiding this comment.
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs:1492
- Ensure that the test case covers scenarios where 'allWorkItemsCompleted.CheckedWait()' might timeout or fail.
allWorkItemsCompleted.CheckedWait();
jkotas
reviewed
Feb 21, 2025
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs
Outdated
Show resolved
Hide resolved
This was referenced Feb 21, 2025
This was referenced Feb 22, 2025
Open
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
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.