Skip to content

.NET Runtime-Async Feature #109632

Open
Open
@agocke

Description

@agocke

Intro

This issue tracks progress on implementing so-called "runtime-async", meaning implementation for async methods directly inside the .NET runtime. This is in contrast to the current support which is implemented only in language compilers, like C#, VB, and F#.

Draft specification: https://github.com/dotnet/runtime/blob/main/docs/design/specs/runtime-async.md

Design issues to be resolved:

  • Are we going to use an attribute of a MethodImpl flag to identify async methods?
    (Re comment:Add draft of runtime async ECMA-335 changes #104063 (comment))
    • Resolved: Yes.
  • What are restrictions and guarantees for runtime async methods in structs.
    • Resolved: By-refs are not preserved across Awaits, so the compiler is responsible for making sure that struct instance methods don't occur across Await
  • What, if any, are the stack requirements on calling a method with the async calling convention inside an async method?
    • Resolved: The stated return type of an async method is the Task-like type. The stack should instead hold the type argument type (or nothing).
  • What do we do for async delegates in general and Func<T> in particular?
    • The helpers will work fine, but the call may be slower than not going through delegates.
  • What do we do for function pointers to async methods?
  • What to do with Event and Property accessors. Presumably they cannot be async, so what happens if return Task and Async marker is applied?
    • Resolved: No special restriction at the runtime level.

Work

Metadata

Metadata

Assignees

Labels

EpicGroups multiple user stories. Can be grouped under a theme.area-VM-coreclr

Type

No type

Projects

Status

No status

Status

UserStories + Epics

Relationships

None yet

Development

No branches or pull requests

Issue actions