Use VoidTaskResult for void returns in runtime async#122285
Merged
jakobbotsch merged 2 commits intodotnet:mainfrom Dec 9, 2025
Merged
Use VoidTaskResult for void returns in runtime async#122285jakobbotsch merged 2 commits intodotnet:mainfrom
VoidTaskResult for void returns in runtime async#122285jakobbotsch merged 2 commits intodotnet:mainfrom
Conversation
Removes some abstraction and unifies behavior with async 1, at the cost of slightly larger instances for void methods.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies the runtime async implementation by removing an abstraction layer and unifying the handling of void-returning async methods with other async methods. The change uses VoidTaskResult as a concrete type parameter instead of maintaining a separate non-generic task implementation.
Key Changes:
- Removed the
IRuntimeAsyncTaskOps<T>interface and its implementations, eliminating unnecessary abstraction - Consolidated
RuntimeAsyncTask(non-generic) andRuntimeAsyncTask<T>into a single generic class by usingVoidTaskResultfor void methods - Converted static generic operations to instance methods for simpler and more direct code
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-threading-tasks |
This was referenced Dec 8, 2025
Open
VSadov
reviewed
Dec 8, 2025
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs
Show resolved
Hide resolved
Member
|
Very nice simplification! Looks fairly straightforward too. Just had a question about |
VSadov
approved these changes
Dec 8, 2025
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.
Removes some abstraction and unifies behavior with async 1 at the cost of these rarely created tasks being slightly larger for void methods.
Fix #122235