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

Feature request: expose strongly typed ExecutionContext.RunInternal #31984

Closed
dmitriyse opened this issue Feb 9, 2020 · 1 comment
Closed
Labels
untriaged New issue has not been triaged by the area owner

Comments

@dmitriyse
Copy link

From the BCL source code:

        // Direct copy of the above RunInternal overload, except that it passes the state into the callback strongly-typed and by ref.
        internal static void RunInternal<TState>(ExecutionContext? executionContext, ContextCallback<TState> callback, ref TState state)
        {
            // Note: ExecutionContext.RunInternal is an extremely hot function and used by every await, ThreadPool execution, etc.

Please expose this method.

This will help Non-BCL developers also optimize their libraries.
Also an implementation of the IValueTaskSource suggests usage of the ExecutionContext.Run and without the typed version most probably additional GC allocation will be required.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Feb 9, 2020
@davidfowl
Copy link
Member

Dupe of #30867. Feel free to send a PR!

@ghost ghost added the will_lock_this label Dec 6, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants